3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = 'Hello World'; $strArray=explode(" ", $str); $strArray=array_reverse($strArray); $str=implode($strArray, " "); echo $str;
Output for 8.4.1 - 8.4.2
Fatal error: Uncaught TypeError: implode(): Argument #1 ($separator) must be of type string, array given in /in/ZfEqQ:5 Stack trace: #0 /in/ZfEqQ(5): implode(Array, ' ') #1 {main} thrown in /in/ZfEqQ on line 5
Process exited with code 255.
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.31, 8.2.0 - 8.2.26, 8.3.0 - 8.3.15
Fatal error: Uncaught TypeError: implode(): Argument #2 ($array) must be of type ?array, string given in /in/ZfEqQ:5 Stack trace: #0 /in/ZfEqQ(5): implode(Array, ' ') #1 {main} thrown in /in/ZfEqQ on line 5
Process exited with code 255.
Output for 7.4.0 - 7.4.33
Deprecated: implode(): Passing glue string after array is deprecated. Swap the parameters in /in/ZfEqQ on line 5 World Hello
Output for 7.2.0 - 7.2.33, 7.3.0 - 7.3.33
World Hello

preferences:
92.93 ms | 413 KiB | 6 Q