3v4l.org

run code in 300+ PHP versions simultaneously
<?php setcookie('b', 'a', 0, array()); setcookie('b', 'a', 0, '/', '', false, false, 'lax');
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.30, 8.2.0 - 8.2.25, 8.3.0 - 8.3.13
Fatal error: Uncaught TypeError: setcookie(): Argument #4 ($path) must be of type string, array given in /in/52qe6:3 Stack trace: #0 /in/52qe6(3): setcookie('b', 'a', 0, Array) #1 {main} thrown in /in/52qe6 on line 3
Process exited with code 255.
Output for 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
Warning: setcookie() expects parameter 4 to be string, array given in /in/52qe6 on line 3 Warning: setcookie() expects at most 7 parameters, 8 given in /in/52qe6 on line 4

preferences:
46.53 ms | 408 KiB | 5 Q