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($com_print);
Output for 7.0.0 - 7.2.0
Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /in/IYgn6 on line 8 NULL
Output for 5.5.24 - 5.6.28
Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /in/IYgn6 on line 8 Notice: Undefined index: face in /in/IYgn6 on line 6 Notice: Undefined index: face in /in/IYgn6 on line 6 string(114) "aaa<img src="1f41b.png" alt="&#128027;" class="smiley" /><img src="1f40d.png" alt="&#128013;" class="smiley" />bbb"
Output for 5.3.17 - 5.4.45
Notice: Undefined index: face in /in/IYgn6 on line 6 Notice: Undefined index: face in /in/IYgn6 on line 6 string(114) "aaa<img src="1f41b.png" alt="&#128027;" class="smiley" /><img src="1f40d.png" alt="&#128013;" class="smiley" />bbb"