3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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(); $tpl = preg_replace("/if\( \<\?php GLOBAL[.*?]\;print+/im", "hhh", $tpl); //$globals = array_unique(array_map("StrToLower", $globals[0])); var_dump($tpl);
based on iRoI4
Output for 5.6.30, hhvm-3.18.5 - 3.22.0, 7.0.30 - 7.3.0alpha1
string(682) "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"