3v4l.org

run code in 300+ PHP versions simultaneously
<?php $temp_terms = $params_arr["pm_other_terms"]; $temp_terms = "jd, jack, jack, jb, jd"; $temp_terms_arr = explode(",", $temp_terms); pr($temp_terms_arr); array_walk($temp_terms_arr, "trimspace"); echo 123; pr($temp_terms_arr); $u_arr = array_unique($temp_terms_arr); pr($u_arr); $f_arr = array_filter($u_arr); pr($f_arr); $pm_other_terms = implode(", ", $f_arr); echo $pm_other_terms; function trimspace(&$var){ $var = trim($var); }
Output for 8.3.0 - 8.3.4, 8.3.6
Warning: Undefined variable $params_arr in /in/stnNd on line 3 Warning: Trying to access array offset on null in /in/stnNd on line 3 Fatal error: Uncaught Error: Call to undefined function pr() in /in/stnNd:6 Stack trace: #0 {main} thrown in /in/stnNd on line 6
Process exited with code 255.
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 Warning: Undefined variable $params_arr in /in/stnNd on line 3 Warning: Trying to access array offset on null in /in/stnNd on line 3 Fatal error: Uncaught Error: Call to undefined function pr() in /in/stnNd:6 Stack trace: #0 {main} thrown in /in/stnNd on line 6
Process exited with code 255.
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18
Warning: Undefined variable $params_arr in /in/stnNd on line 3 Warning: Trying to access array offset on value of type null in /in/stnNd on line 3 Fatal error: Uncaught Error: Call to undefined function pr() in /in/stnNd:6 Stack trace: #0 {main} thrown in /in/stnNd on line 6
Process exited with code 255.
Output for 7.4.0 - 7.4.33
Notice: Undefined variable: params_arr in /in/stnNd on line 3 Notice: Trying to access array offset on value of type null in /in/stnNd on line 3 Fatal error: Uncaught Error: Call to undefined function pr() in /in/stnNd:6 Stack trace: #0 {main} thrown in /in/stnNd on line 6
Process exited with code 255.
Output for 7.3.32 - 7.3.33
Fatal error: Uncaught Error: Call to undefined function pr() in /in/stnNd:6 Stack trace: #0 {main} thrown in /in/stnNd on line 6
Process exited with code 255.
Output for 7.0.0 - 7.0.31, 7.1.0 - 7.1.23, 7.2.0 - 7.2.33, 7.3.16 - 7.3.31
Notice: Undefined variable: params_arr in /in/stnNd on line 3 Fatal error: Uncaught Error: Call to undefined function pr() in /in/stnNd:6 Stack trace: #0 {main} thrown in /in/stnNd on line 6
Process exited with code 255.
Output for 5.5.0 - 5.5.38, 5.6.0 - 5.6.38
Notice: Undefined variable: params_arr in /in/stnNd on line 3 Fatal error: Call to undefined function pr() in /in/stnNd on line 6
Process exited with code 255.

preferences:
167.01 ms | 402 KiB | 286 Q