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);

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.5.00.0140.00920.05
8.4.150.0020.00014.05
8.4.140.0120.00918.06
8.4.130.0120.00919.58
8.4.120.0160.00424.01
8.4.110.0110.01121.65
8.4.100.0070.00417.66
8.4.90.0170.00418.18
8.4.80.0140.00718.06
8.4.70.0050.00318.08
8.4.60.0120.00917.89
8.4.50.0120.00918.53
8.4.40.0070.01317.77
8.4.30.0030.01720.32
8.4.20.0120.00918.07
8.4.10.0030.00619.59
8.3.280.0150.00618.75
8.3.270.0090.01416.89
8.3.260.0150.00416.82
8.3.250.0110.00818.86
8.3.240.0050.00519.09
8.3.230.0110.00516.89
8.3.220.0090.00416.74
8.3.210.0100.00916.77
8.3.200.0100.01016.80
8.3.190.0040.00417.11
8.3.180.0120.00717.27
8.3.170.0170.00020.78
8.3.160.0060.01216.77
8.3.150.0110.00716.73
8.3.140.0040.01119.05
8.3.130.0030.00718.58
8.3.120.0090.00019.11
8.3.110.0100.01020.94
8.3.100.0140.00418.80
8.3.90.0070.01318.67
8.3.80.0090.00018.68
8.3.70.0150.00018.56
8.3.60.0040.01118.68
8.3.50.0120.00616.68
8.3.40.0040.01121.95
8.3.30.0140.00019.21
8.3.20.0040.00424.18
8.3.10.0040.00424.66
8.3.00.0080.00026.16
8.2.290.0100.00818.81
8.2.280.0090.01116.90
8.2.270.0160.00317.45
8.2.260.0110.00716.72
8.2.250.0040.00416.90
8.2.240.0050.00319.05
8.2.230.0070.00722.58
8.2.220.0100.00024.06
8.2.210.0080.01126.77
8.2.200.0040.00816.88
8.2.190.0040.01216.88
8.2.180.0170.00316.86
8.2.170.0130.00719.07
8.2.160.0070.01422.96
8.2.150.0000.00725.66
8.2.140.0080.00024.66
8.2.130.0050.00326.16
8.2.120.0050.00320.08
8.2.110.0120.00019.01
8.2.100.0030.01018.16
8.2.90.0140.01417.50
8.2.80.0230.00817.50
8.2.70.0250.00717.61
8.2.60.0250.00617.63
8.2.50.0210.01217.50
8.2.40.0150.01217.50
8.2.30.0230.00317.88
8.2.20.0090.00617.75
8.2.10.0160.01317.40
8.2.00.0230.00317.63
8.1.330.0080.01022.14
8.1.320.0120.00815.93
8.1.310.0030.00516.37
8.1.300.0060.00318.50
8.1.290.0090.00018.88
8.1.280.0090.01225.92
8.1.270.0030.00524.66
8.1.260.0000.00826.35
8.1.250.0000.00728.09
8.1.240.0090.00022.46
8.1.230.0230.00417.50
8.1.220.0240.00317.50
8.1.210.0220.00817.40
8.1.200.0220.01017.40
8.1.190.0250.00317.46
8.1.180.0230.00317.40
8.1.170.0190.01017.40
8.1.160.0230.00317.40
8.1.150.0180.01117.40
8.1.140.0210.00817.40
8.1.130.0160.01317.40
8.1.120.0180.00817.50
8.1.110.0250.00317.40
8.1.100.0270.00017.63
8.1.90.0230.00317.50
8.1.80.0230.00617.40
8.1.70.0240.00417.40
8.1.60.0170.00817.40
8.1.50.0290.00017.50
8.1.40.0270.00017.60
8.1.30.0250.00417.40
8.1.20.0200.00817.63
8.1.10.0220.00617.50
8.1.00.0250.00417.40
8.0.300.0130.00017.40
8.0.290.0220.00617.40
8.0.280.0250.00417.40
8.0.270.0270.00017.40
8.0.260.0220.00717.40
8.0.250.0200.00617.40
8.0.240.0250.00317.40
8.0.230.0260.00317.40
8.0.220.0240.00417.40
8.0.210.0240.00317.40
8.0.200.0220.00617.40
8.0.190.0260.00017.40
8.0.180.0200.00617.40
8.0.170.0210.00717.40
8.0.160.0110.00817.40
8.0.150.0100.00717.40
8.0.140.0110.00617.40
8.0.130.0130.01017.40
8.0.120.0200.00617.40
8.0.110.0230.00817.40
8.0.100.0200.00917.40
8.0.90.0180.00817.40
8.0.80.0230.00517.40
8.0.70.0260.00317.40
8.0.60.0210.00717.40
8.0.50.0070.00717.40
8.0.30.0040.00917.40
8.0.20.0130.00017.40
8.0.10.0050.00817.40

preferences:
37.38 ms | 403 KiB | 5 Q