3v4l.org

run code in 300+ PHP versions simultaneously
<?php $names = [ "Mr. Kiefer William Frederick Dempsey George Rufus Sutherland Sr.", "Carolina Maria de Jesus", "Kiefer William Frederick Dempsey George Rufus Sutherland Jr.", "Mrs. Carolina Maria de Jesus"]; foreach($names as $name) { preg_match('/(?:\w+\. )?(\w+).*?(\w+)(?: \w+\.)?$/', $name, $result); echo $result[1] . ' ' . $result[2] . ' = ' . $result[1][0].$result[2][0] . PHP_EOL; }
Output for git.master, git.master_jit, rfc.property-hooks
Kiefer Sutherland = KS Carolina Jesus = CJ Kiefer Sutherland = KS Carolina Jesus = CJ

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
54.97 ms | 405 KiB | 5 Q