3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $heart = "love"; $pat = "[♥]+"; $sub = "heart"; $code = mb_ereg_replace( $pat, $sub, "I \$♥ PHP" ); var_dump($code); echo eval("\$code");
based on ZtJFB
Output for 7.0.0 - 7.2.0
string(12) "I $heart PHP" Parse error: syntax error, unexpected end of file in /in/bUaH2(7) : eval()'d code on line 1
Process exited with code 255.
Output for 5.6.8 - 5.6.28
string(12) "I $heart PHP" Parse error: syntax error, unexpected end of file in /in/bUaH2(7) : eval()'d code on line 1
Output for 5.4.11 - 5.5.35
Warning: mb_ereg_replace(): mbregex compile err: premature end of char-class in /in/bUaH2 on line 5 bool(false) Parse error: syntax error, unexpected end of file in /in/bUaH2(7) : eval()'d code on line 1
Output for 5.4.0 - 5.4.10
Warning: mb_ereg_replace(): mbregex compile err: premature end of char-class in /in/bUaH2 on line 5 bool(false) Parse error: syntax error, unexpected end of file in /in/bUaH2(7) : eval()'d code on line 1
Process exited with code 255.
Output for 5.3.0 - 5.3.29
Warning: mb_ereg_replace(): mbregex compile err: premature end of char-class in /in/bUaH2 on line 5 bool(false) Parse error: syntax error, unexpected $end in /in/bUaH2(7) : eval()'d code on line 1
Process exited with code 255.
Output for 5.1.0 - 5.2.17
string(12) "I $heart PHP" Parse error: syntax error, unexpected $end in /in/bUaH2(7) : eval()'d code on line 1
Process exited with code 255.
Output for 5.0.0 - 5.0.5
string(12) "I $heart PHP" Parse error: parse error, unexpected $ in /in/bUaH2(7) : eval()'d code on line 1
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Warning: mb_ereg_replace(): mbregex compile err: premature end of regular expression in /in/bUaH2 on line 5 bool(false) Parse error: syntax error, unexpected $end in /in/bUaH2(7) : eval()'d code on line 1
Process exited with code 255.
Output for 4.3.5 - 4.4.1
Warning: mb_ereg_replace(): mbregex compile err: premature end of regular expression in /in/bUaH2 on line 5 bool(false) Parse error: parse error, unexpected $ in /in/bUaH2(7) : eval()'d code on line 1
Process exited with code 255.
Output for 4.3.4
Warning: mb_ereg_replace(): mbregex compile err: premature end of regular expression in /in/bUaH2 on line 5 bool(false) Parse error: parse error in /in/bUaH2(7) : eval()'d code on line 1
Process exited with code 255.
Output for 4.3.2 - 4.3.3
Fatal error: Call to undefined function: mb_ereg_replace() in /in/bUaH2 on line 5
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: mb_ereg_replace() in /in/bUaH2 on line 5