3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function str_emoji($str){ function empic($h){ $p=dechex(str_replace(array('&#',';'),'',$h)); return '<img src="_POST[face]'.$p.'.png" alt="'.$h.'" class="smiley" />'; }; $str=preg_replace('#(\&\#[0-9]{6}\;)#ie','empic("\\1")',$str); return $str; }; //$com_print=str_emoji('aaa&#128027;&#128013;bbb'); var_dump(empic(123));
based on cgQBa
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Call to undefined function empic() in /in/3RPsk:12 Stack trace: #0 {main} thrown in /in/3RPsk on line 12
Process exited with code 255.
Output for 5.3.17 - 5.6.28
Fatal error: Call to undefined function empic() in /in/3RPsk on line 12
Process exited with code 255.