3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); class x { function __toString() : string { return "YES"; } } function foo(string $a) {} // piece of syntax of the day (POSOTD) echo $x = new x; print " A $x"; // Fata error: Argument #1 ($a) must be of type string, x given, foo($x); ?>
Output for 8.1.32 - 8.1.34, 8.2.0 - 8.2.30, 8.3.0 - 8.3.30, 8.4.1 - 8.4.18, 8.5.0 - 8.5.3
YES A YES

preferences:
47.49 ms | 845 KiB | 4 Q