Fix issue #2681 should be compitable with php from 4 & up.

I have tested it on PHP 5.4.9, but this should be compatible with all version from 4 & up.