3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = 'x'; str_replace($a , array () , $GLOBALS ); echo "hello";
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
Fatal error: Uncaught TypeError: str_replace(): Argument #2 ($replace) must be of type string when argument #1 ($search) is a string in /in/iUlQu:4 Stack trace: #0 /in/iUlQu(4): str_replace('x', Array, Array) #1 {main} thrown in /in/iUlQu on line 4
Process exited with code 255.
Output for 7.3.21 - 7.3.31, 7.3.33, 7.4.9 - 7.4.25, 7.4.27 - 7.4.33
Notice: Array to string conversion in /in/iUlQu on line 4 hello
Output for 7.3.32, 7.4.26
hello
Output for 7.2.0 - 7.2.33, 7.3.0 - 7.3.20, 7.4.0 - 7.4.8
Notice: Array to string conversion in /in/iUlQu on line 4
Process exited with code 139.

preferences:
158.37 ms | 402 KiB | 177 Q