3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function dangerous() { echo 'Dangerous code executed'; } $arg = '42{${dangerous()}}'; preg_replace("/([0-9]+)(.+)/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/oIT0U on line 9 Notice: Undefined variable: var in /in/oIT0U on line 10 Notice: Undefined variable: var2 in /in/oIT0U on line 10 NULL NULL
Output for hhvm-3.10.0 - 3.12.0
Dangerous code executed Notice: Undefined variable: Notice: Array to string conversion in /in/oIT0U on line 9 Notice: Undefined variable: var in /in/oIT0U on line 10 Notice: Undefined variable: var2 in /in/oIT0U on line 10 NULL NULL
Output for 5.5.0 - 5.6.28
Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /in/oIT0U on line 9 Dangerous code executed Notice: Undefined variable: in /in/oIT0U(9) : regexp code on line 1 Notice: Array to string conversion in /in/oIT0U on line 9 string(2) "42" string(0) ""
Output for 5.0.4 - 5.4.45
Dangerous code executed Notice: Undefined variable: in /in/oIT0U(9) : regexp code on line 1 Notice: Array to string conversion in /in/oIT0U on line 9 string(2) "42" string(0) ""
Output for 4.3.0 - 5.0.3
Dangerous code executed Notice: Undefined variable: in /in/oIT0U(9) : regexp code on line 1 Notice: Array to string conversion in /in/oIT0U on line 9 string(2) "42" string(0) ""