<?php
class B {
function __toString() {
echo ".".__CLASS__;
}
}
class A extends B {
function __toString() {
echo ".".__CLASS__;
}
}
echo new B();
echo new A();
.B
Fatal error: Uncaught TypeError: B::__toString(): Return value must be of type string, none returned in /in/aGtp6:5
Stack trace:
#0 /in/aGtp6(13): B->__toString()
#1 {main}
thrown in /in/aGtp6 on line 5
Process exited with code 255.
Output for 7.4.0 - 7.4.33
.B
Fatal error: Uncaught Error: Method B::__toString() must return a string value in /in/aGtp6:13
Stack trace:
#0 {main}
thrown in /in/aGtp6 on line 13
Process exited with code 255.