3v4l.org

run code in 300+ PHP versions simultaneously
<?php $tests = [ 'LocalBusiness' => 'Local Business', 'CivicStructureBuilding' => 'Civic Structure Building', 'getUserMobilePhoneNumber' => 'Get User Mobile Phone Number', 'bandGuitar1' => 'Band Guitar 1', 'band2Guitar123' => 'Band 2 Guitar 123', 'CustomerIDWithSomeOtherJETWords' => 'Customer ID With Some Other JET Words', 'noOneIsMightierThanI' => 'No One Is Mightier Than I', 'USAIsNumber14' => 'USA Is Number 14', '99LuftBallons' => '99 Luft Ballons', 'fillOutYour403EForm' => 'Fill Out Your 403 E Form', 'ABC123IsEasyAs' => 'ABC 123 Is Easy As', ]; $result = []; foreach ($tests as $input => $expected) { $newString = ucwords( preg_replace( '/(?: [A-Z]+? (?=\d|[A-Z][a-z]) #acronyms |[A-Z]?[a-z]+ (?=[^a-z]) #words |\d+ (?=\D) #numbers |(*SKIP)(*FAIL) #abort )\K /x', ' ', $input ) ); $result[] = ($newString === $expected ? 'PASSED' : 'FAILED') . ': "' . $newString . '"'; } var_export($result);
Output for git.master_jit, git.master, rfc.property-hooks
array ( 0 => 'PASSED: "Local Business"', 1 => 'PASSED: "Civic Structure Building"', 2 => 'PASSED: "Get User Mobile Phone Number"', 3 => 'PASSED: "Band Guitar 1"', 4 => 'PASSED: "Band 2 Guitar 123"', 5 => 'PASSED: "Customer ID With Some Other JET Words"', 6 => 'PASSED: "No One Is Mightier Than I"', 7 => 'PASSED: "USA Is Number 14"', 8 => 'PASSED: "99 Luft Ballons"', 9 => 'PASSED: "Fill Out Your 403 E Form"', 10 => 'PASSED: "ABC 123 Is Easy As"', )

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:
94.52 ms | 406 KiB | 5 Q