3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $word = "word,!pineapple--pizza"; $revd = preg_replace_callback('#([A-Za-z]+)#', 'rev_first', $word); function rev_first($matches){ return strrev($matches[1]); } var_dump($revd);
based on JI7vJ
Output for 4.3.0 - 7.1.0
string(22) "drow,!elppaenip--azzip"