3v4l.org

run code in 500+ PHP versions simultaneously
<?php declare(strict_types = 1); if (! class_exists('undefined')) { class undefined {} } if (! defined('undefined')) { define('undefined', new undefined()); } class X { function foo( SomeType|undefined $object = undefined, bool|undefined $option = undefined, ) { return match($object) { undefined => new DefaultBehavior(), default => $object->someMethod() }; } }
Output for 8.2.32, 8.3.5 - 8.3.32, 8.4.9 - 8.4.23, 8.5.7 - 8.5.8

preferences:
53.54 ms | 521 KiB | 4 Q