Having seen C#, while not perfect, it is an interesting model. There's a very short note on C#, and an idea for a PHP syntax. http://www.akbkhome.com/wiki.php/DBDO/signals.html
It suggests:
class xxxx {
// event registers a method, that hooks into the generic event handler.
public event $onDebug = array();
function somemethod() {
// add a handler to an event..
// this is the natrual syntax for this, but does open the door to someone wiping the stack!
$this->onDebug[] = array($this,'mycallback');
// initiate the signals. (function name matches the var!) $this->onDebug($x,$y); } // a handler.. function mycallback($x,$y) { echo "debug hander got $x , $y\n"; } }
Anyone care to comment on a) the feasibility b) the "should it be implemented" question. c) the "any better ideas" question...
Regards Alan
-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php