3v4l.org

run code in 300+ PHP versions simultaneously
<?php function stuff(int $i, string $s, float $f, Point $p, int $m = 0) {} try { str_replace(1); } catch(ArgumentCountError $e) { echo $e->getMessage(), PHP_EOL; } try { stuff(1); } catch(ArgumentCountError $e) { echo $e->getMessage(), PHP_EOL; }
Output for 8.1.34, 8.2.0 - 8.2.30, 8.3.0 - 8.3.30, 8.4.1 - 8.4.18, 8.5.0 - 8.5.3
str_replace() expects at least 3 arguments, 1 given Too few arguments to function stuff(), 1 passed in /in/3G8EO on line 11 and at least 4 expected

preferences:
65.55 ms | 407 KiB | 5 Q