All pastes #459282 Raw Edit

berry__

public php v1 · immutable
#459282 ·published 2007-04-26 11:26 UTC
rendered paste body
<?phpclass String{  public function __construct ( $string )  {    $this -> string = $string;  }  public function __toString ()  {    return $this -> string;  }}class ProofOfConcept{  public function __construct ()  {    $reflection = new ReflectionClass ( 'ProofOfConcept' );    foreach ( $reflection -> getMethods () AS $method )    {      $constructParametersCount = func_num_args ();      if ( $constructParametersCount === count ( $method -> getNumberOfParameters () ) )      {        $i = 0;        foreach ( $method -> getParameters () AS $parameter )        {          $name = $parameter -> getName ();          $datatypeClass = ( is_null ( $parameter -> getClass () ) === false ) ? $parameter -> getClass () : false;          $datatype = ( $datatypeClass !== false ) ? $datatypeClass -> getName () : false;          if ( $datatype !== false )          {            if ( func_get_arg ( $i ) instanceof $datatype )            {              $candidate ++;            }          }        }      }    }  }  public function constructor1 ( String $test )  {    echo 'haha';  }}$proofOfConcept = new ProofOfConcept ( 'test' );?>