xref: /PHP-7.4/ext/spl/tests/bug64023.phpt (revision d679f022)
1--TEST--
2Bug #64023: Overloading __toString() in SplFileInfo has no effect
3--FILE--
4<?php
5class A extends \SplFileInfo
6{
7	    public function __toString() {return ' -expected- ';}
8}
9
10$a = new A('/');
11
12// Works
13echo $a, $a->__toString(), $a->__toString() . '', "\n";
14
15// Does not work - outputs parent::__toString()
16echo $a . '', "\n";
17--EXPECT--
18 -expected-  -expected-  -expected-
19 -expected-
20