Closed thekid closed 10 years ago
The added test passes, but for some reason tests/string.phpt
fails on Travis (but works locally on my machine). Might be related to me using PHP head checkout and Travis using PHP 5.4
Thanks, this is merged now! See https://github.com/nikic/scalar_objects/commit/9d60e480dcd723d54f13b0ad5610880e4cdbfd65. I removed the zval_dtor(obj) call, as it the object will be destroyed by FREE_OP1_IF_VAR() already.
Btw, the string.phpt issue you encountered is actually a bug in PHP - just submitted a report: https://bugs.php.net/bug.php?id=67151
This pull request fixes a segmentation fault when invocations fall back to
__callStatic
:The hack that
$this
is available in the primitive handler methods and points to the value the method is called on although they're actually static methods doesn't work here. See the comment inzend_vm_def.h
in itsZEND_VM_HELPER(zend_do_fcall_common_helper...)
: An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. Why the Zend Engine treats__callStatic
as an internal function is not 100% clear to me; an educated guess is that it's for performance reasons.