All pastes #459280 Raw Edit

Someone

public text v1 · immutable
#459280 ·published 2007-04-26 11:25 UTC
rendered paste body
<?php

class 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' );

?>