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); ?>

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
162.1 ms | 1456 KiB | 8 Q