3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function test() {echo "THIS SHOULD NOT BE SEEN!!\n";} function ryat($a) {var_dump($a);} $str = "', test(), '"; echo "mb_ereg_replace()\n"; var_dump(mb_ereg_replace('^(.*)$', "ryat('\\1')", $str, 'e')); echo "\npreg_replace()\n"; var_dump(preg_replace('/^(.*)$/e', "ryat('\\1')", $str));
based on jm2gt
Output for 7.1.0
mb_ereg_replace() Deprecated: mb_ereg_replace(): The 'e' option is deprecated, use mb_ereg_replace_callback instead in /in/rcXvG on line 9 THIS SHOULD NOT BE SEEN!! string(0) "" string(0) "" preg_replace() Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /in/rcXvG on line 12 NULL
Output for 7.0.0 - 7.0.14
mb_ereg_replace() THIS SHOULD NOT BE SEEN!! string(0) "" string(0) "" preg_replace() Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /in/rcXvG on line 12 NULL
Output for hhvm-3.10.0 - 3.12.0
mb_ereg_replace() Fatal error: ereg_replace is not supported: dynamic coding in /in/rcXvG on line 9
Process exited with code 255.
Output for 5.5.24 - 5.6.28
mb_ereg_replace() THIS SHOULD NOT BE SEEN!! string(0) "" string(0) "" preg_replace() Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /in/rcXvG on line 12 string(12) "', test(), '" string(0) ""
Output for 4.3.4 - 5.4.45
mb_ereg_replace() THIS SHOULD NOT BE SEEN!! string(0) "" string(0) "" preg_replace() string(12) "', test(), '" string(0) ""
Output for 4.3.2 - 4.3.3
mb_ereg_replace() Fatal error: Call to undefined function: mb_ereg_replace() in /in/rcXvG on line 9
Process exited with code 255.
Output for 4.3.0 - 4.3.1
mb_ereg_replace() Fatal error: Call to undefined function: mb_ereg_replace() in /in/rcXvG on line 9