Just added `tests/standalone/bug01011-002.phpt`. Memory leak can be checked with:

```
$ export USE_ZEND_ALLOC=0
$ valgrind --show-reachable=yes --leak-check=full php tests/standalone/bug01011-002.phpt
```