3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $word = "Hello World"; $revd = preg_replace_callback('#([A-Za-z]+)#', 'rev_first', $word); function rev_first($matches){ return strrev($matches[1]); } var_dump($revd);
based on K0Ebm
Output for 4.3.0 - 7.1.0
string(11) "olleH dlroW"