3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo (string $x) { } try { foo(); } catch (\TypeError $t) { echo 'Oops! ' . $t->getMessage(); }
Output for 7.4.32, 8.1.34, 8.2.30, 8.3.5 - 8.3.29, 8.4.9 - 8.4.16, 8.5.0 - 8.5.1
Oops! Too few arguments to function foo(), 0 passed in /in/uSJIX on line 7 and exactly 1 expected

preferences:
59.26 ms | 406 KiB | 5 Q