note 11887 deleted from function.call-user-func by felipe

[email protected]
Newsgroups php.notes
Message-ID <[email protected]>
Note Submitter: dayiogluNOSPAM at metu dot edu dot tr dot NOSPAM 

----

Happily call_user_func can now call
methods of some existing objects; added
to the CVS Fri Mar  9 18:09:26 2001 EDT.

Below is an example:

<?php

class provider {
  function myfunction($x) {
    echo "burak was at $x\n";
  }
}

class dispatcher {
  function process($p2,$p3) {
    call_user_func($p2, $p3);
  }
}

function independent()
{
  echo "just a test";
}

$x= new provider();
$y= new dispatcher();

$y->process(array($x,'myfunction'),"conference");
$y->process(independent,"");

?>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.