Fixed segfault in php 5.2