class ZookeeperDemo extends Zookeeper {
public function watcher( $i, $type, $key ) {
echo "Insider Watcher\n";
// Watcher gets consumed so we need to set a new one
$this->get( '/bar', array($this, 'watcher' ) );
}
}
$zoo = new ZookeeperDemo('127.0.0.1:2181');
$zoo->set('/bar', 1);
$zoo->get( '/bar', array($zoo, 'watcher') );
while( true ) {
echo '.';
sleep(2);
}
running this in php-5.5.6 will report a php warning:
PHP Warning: Unknown: could not invoke watcher callback in Unknown on line 0
running this in php-5.5.6 will report a php warning: PHP Warning: Unknown: could not invoke watcher callback in Unknown on line 0