]> granicus.if.org Git - php/commit
Fix bug #64023 (__toString() & SplFileInfo)
authorGustavo Lopes <glopes@nebm.ist.utl.pt>
Sat, 19 Jan 2013 15:21:26 +0000 (16:21 +0100)
committerGustavo Lopes <glopes@nebm.ist.utl.pt>
Tue, 22 Jan 2013 10:33:29 +0000 (11:33 +0100)
commitaa0adce47d9b8ead59efede63a769e395e27bcd5
treec24043df71456c3c84619c5b27dfbd3a72f23391
parent33b104c778c5c0e5446671397aaddd66efa4a7bc
Fix bug #64023 (__toString() & SplFileInfo)

Defining a __toString() method was having no effect when concatenating
the object. This was because the cast_object() handler would ignore
__toString().

Using echo() directly would actually use __toString(), but this was a
bug: the ECHO handler would try zend_std_cast_object_tostring() before
cast_object(), but cast_object() should have priority as
zend_std_cast_object_tostring() assumes an object with a
zend_class_entry.
Zend/zend_vm_def.h
Zend/zend_vm_execute.h
ext/spl/spl_directory.c
ext/spl/tests/bug64023.phpt [new file with mode: 0644]