Page 1 of 1

What's this function mean? call_user_func_array()

Posted: Tue Dec 04, 2007 7:55 pm
by yanglei1979
Please Look the code:

Code: Select all

<?php
  class Object1 {
    function Object1() {
	echo"bbbbbbbbbbbbbbbbbbbb";
      $args= func_get_args();
      call_user_func_array(array(&$this, 'aaa'), $args);
    }

    function aaa($args) {
	
	echo"eeeeeeeeee";
	echo $args;
      
    }
  }

  $c= new Object1('123');
  
  
?>

Can you tell me Why use "&$this"?

Posted: Tue Dec 04, 2007 7:58 pm
by feyd
So PHP uses the object instance instead of a copy of one (in PHP 4.)