3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); class Foo implements stringable { public function __toString(): string { return "John"; } } function bar(string $blah) { echo $blah; } function quux(string|stringable $value) { bar((string)$value); } quux(new Foo);

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
160.54 ms | 1675 KiB | 12 Q