Revert "Fix for php5.4"

This reverts commit ece3d2f2a389c3ed063d8a7fc56ab791790527cc.
Revert "Revert "Fix for php5.4""

This reverts commit 299b325b8be8d70f54abe1e3caf5b57c49ed882f.