All pastes #200685 Raw Edit

Anonymous

public php v1 · immutable
#200685 ·published 2006-10-13 09:44 UTC
rendered paste body
<?phpclass TestC {  private $test;  public function __construct( $val ) {    $this->test = $val;  }  public function setVal( $val ) {    $this->test = $val;  }  public function getVal() {    return $this->test;  }}function change_val( $class ) {  $class->setVal( 'testing from function' );}$obj = new TestC('testing from construct');call_user_func( 'change_val', $obj );echo $obj->getVal();// returns "testing from function"?>