3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function dangerous() { echo 'Dangerous code executed'; } $arg = '42a{${dangerous()}}'; preg_replace("/([0-9]+)([a-z]+)/e",'list($var, $var2) = array("$1", "$2")', $arg); var_dump($var, $var2);
Output for 7.0.0 - 7.1.0
Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /in/mlm2G on line 9 Notice: Undefined variable: var in /in/mlm2G on line 10 Notice: Undefined variable: var2 in /in/mlm2G on line 10 NULL NULL
Output for 5.5.24 - 5.6.28
Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /in/mlm2G on line 9 Notice: Array to string conversion in /in/mlm2G on line 9 string(2) "42" string(1) "a"
Output for 4.3.0 - 5.4.45
Notice: Array to string conversion in /in/mlm2G on line 9 string(2) "42" string(1) "a"