andreiz/php-zookeeper — pull request #22 by ryanuber (2013-04-11 02:16:05+00:00)
Title: Respect null's when passed as values during set(), create(), and get().

This change set fixes NULL handling in php-zookeeper.

Before (notice my null gets cast to string):
```
php > $z = new Zookeeper('127.0.0.1:2181');
php > $z->create('/test', null, array(array('perms' => Zookeeper::PERM_ALL, 'scheme' => 'world', 'id' => 'anyone')));
php > var_dump($z->get('/test'));
string(0) ""
```

After (null is preserved):
```
php > $z = new Zookeeper('127.0.0.1:2181');
php > $z->create('/test', null, array(array('perms' => Zookeeper::PERM_ALL, 'scheme' => 'world', 'id' => 'anyone')));
php > var_dump($z->get('/test'));
NULL
php >
```

This patch also fixes a segfault. If there is a znode in your zookeeper server somewhere with a NULL value and you attempt to read it, you get this:
```
php > var_dump($z->get('/test'));
string(-1) "Segmentation fault
```

With this patch, this would look more like this:
```
php > var_dump($z->get('/test'));
NULL
```