diff options
Diffstat (limited to 'ext/spl/tests/bug64023.phpt')
-rw-r--r-- | ext/spl/tests/bug64023.phpt | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/ext/spl/tests/bug64023.phpt b/ext/spl/tests/bug64023.phpt new file mode 100644 index 0000000000..2c177f9512 --- /dev/null +++ b/ext/spl/tests/bug64023.phpt @@ -0,0 +1,20 @@ +--TEST-- +Bug #64023: Overloading __toString() in SplFileInfo has no effect +--FILE-- +<?php +class A extends \SplFileInfo +{ + public function __toString() {return ' -expected- ';} +} + +$a = new A('/'); + +// Works +echo $a, $a->__toString(), $a->__toString() . '', "\n"; + +// Does not work - outputs parent::__toString() +echo $a . '', "\n"; + +--EXPECT-- + -expected- -expected- -expected- + -expected- |