getChildren() will fail if you pass null for the callback. Normally you would just omit the parameter but in the case you are extending the the Zookeeper class, your function ends up passing the variable as null.
$zk->getChildren('/test', null); //returns null
$zk->getChildren('/test'); //returns array of znodes
This is what I was doing when I discovered the issue. If you omit $watcher_cb then its assigned value null, but since its passed in the parent call it silently breaks and returns NULL.
class zk extends Zookeeper {
public function getChildren( $path, $watcher_cb = null) {
return parent::getChildren( $path, $watcher_cb );
}
}
getChildren() will fail if you pass null for the callback. Normally you would just omit the parameter but in the case you are extending the the Zookeeper class, your function ends up passing the variable as null.
$zk->getChildren('/test', null); //returns null $zk->getChildren('/test'); //returns array of znodes
This is what I was doing when I discovered the issue. If you omit $watcher_cb then its assigned value null, but since its passed in the parent call it silently breaks and returns NULL.
class zk extends Zookeeper { public function getChildren( $path, $watcher_cb = null) { return parent::getChildren( $path, $watcher_cb ); } }