3v4l.org

run code in 300+ PHP versions simultaneously
<?php $tpl = "The side bar{l:{khalid}} s a Cheatsheet,{l:{test}} full Reference, and Help. You can also Save & Share with the Community, and {{kaitbellahs}}view patterns you{{eu mesmo}} create or favorite in My Patterns. Global #kha; print #kha; Global #main; print #main-['kha']; Global #main; print #main-['kha']; Global #main; print #main-['kha']; Global #kha1; print #1kha; Global #1kha; print #kha1; <!DOCTYPE html> <html <?php if( <?php GLOBAL #main;print #main->conf['amp']; ?> ){ print \"amp\"; } ?> lang=\" <?php GLOBAL #main;print #main->lng['lng']; ?> \"> <head> Explore results with the Tools below. Replace & List output custom results. Details lists capture groups. Explain d"; //$globals = array(); preg_replace("/if\( \<\?php GLOBAL[.*?]\;print+/im", "hhh", $tpl); $globals = array_unique(array_map("StrToLower", $globals[0])); var_dump($globals);
Output for 8.3.0 - 8.3.4, 8.3.6
Warning: Undefined variable $globals in /in/iRoI4 on line 15 Warning: Trying to access array offset on null in /in/iRoI4 on line 15 Fatal error: Uncaught TypeError: array_map(): Argument #2 ($array) must be of type array, null given in /in/iRoI4:15 Stack trace: #0 /in/iRoI4(15): array_map('StrToLower', NULL) #1 {main} thrown in /in/iRoI4 on line 15
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 $globals in /in/iRoI4 on line 15 Warning: Trying to access array offset on null in /in/iRoI4 on line 15 Fatal error: Uncaught TypeError: array_map(): Argument #2 ($array) must be of type array, null given in /in/iRoI4:15 Stack trace: #0 /in/iRoI4(15): array_map('StrToLower', NULL) #1 {main} thrown in /in/iRoI4 on line 15
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 $globals in /in/iRoI4 on line 15 Warning: Trying to access array offset on value of type null in /in/iRoI4 on line 15 Fatal error: Uncaught TypeError: array_map(): Argument #2 ($array) must be of type array, null given in /in/iRoI4:15 Stack trace: #0 /in/iRoI4(15): array_map('StrToLower', NULL) #1 {main} thrown in /in/iRoI4 on line 15
Process exited with code 255.
Output for 7.4.0 - 7.4.33
Notice: Undefined variable: globals in /in/iRoI4 on line 15 Notice: Trying to access array offset on value of type null in /in/iRoI4 on line 15 Warning: array_map(): Expected parameter 2 to be an array, null given in /in/iRoI4 on line 15 Warning: array_unique() expects parameter 1 to be array, null given in /in/iRoI4 on line 15 NULL
Output for 7.3.32 - 7.3.33
Warning: array_map(): Expected parameter 2 to be an array, null given in /in/iRoI4 on line 15 Warning: array_unique() expects parameter 1 to be array, null given in /in/iRoI4 on line 15 NULL
Output for 7.3.16 - 7.3.31
Notice: Undefined variable: globals in /in/iRoI4 on line 15 Warning: array_map(): Expected parameter 2 to be an array, null given in /in/iRoI4 on line 15 Warning: array_unique() expects parameter 1 to be array, null given in /in/iRoI4 on line 15 NULL
Output for 7.1.0 - 7.1.20, 7.2.0 - 7.2.33
Notice: Undefined variable: globals in /in/iRoI4 on line 15 Warning: array_map(): Argument #2 should be an array in /in/iRoI4 on line 15 Warning: array_unique() expects parameter 1 to be array, null given in /in/iRoI4 on line 15 NULL

preferences:
192.03 ms | 402 KiB | 162 Q