3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "luke"; echo preg_replace_callback('~^(?![eiux])[a-z]~', function($m) { return ucfirst($m[0]); }, $str); $str = "egg"; echo "\n" . preg_replace_callback('~^(?![eiux])[a-z]~', function($m) { return ucfirst($m[0]); }, $str);

preferences:
56.61 ms | 405 KiB | 5 Q