3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types = 1); class Foo { /** * @param int $i * @return void */ public function bar($i) {} public function baz(int $i): void {} } /** * @method string bar(bool $b, object $o) * @method string baz(bool $b, object $o) */ class Woo extends Foo {} $w = new Woo(); $r1 = $w->bar(true, new \stdClass); $r2 = $w->baz(true, new \stdClass); //$r3 = $w->bar(123); //$r4 = $w->baz(123); function test(float $f) {}; test($r1); test($r2); //test($r3); //test($r4);

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
168.54 ms | 2656 KiB | 12 Q