3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Setup $count = 1000; function camelcaseCurrent($file) { $r1 = ucwords(str_replace(array('_', '-', '/'), ' ', $file)); $r2 = str_replace(' ', '', $r1); return $r2; } function camelcaseNew($file) { $r1 = ucwords(str_replace(array('_', '-', '/'), '', $file)); $r2 = str_replace(' ', '', $r1); return $r2; } // Warm up for($i = 0; $i < $count; $i++) { camelcaseCurrent('asset_library'); camelcaseNew('asset_library'); } // Test - current $t0 = microtime(true); for($i = 0; $i < $count; $i++) { camelcaseCurrent('asset_library'); } $deltaCurrent = microtime(true) - $t0; // Test - new $t0 = microtime(true); for($i = 0; $i < $count; $i++) { camelcaseNew('asset_library'); } $deltaNew = microtime(true) - $t0; echo "case current: ", round($deltaCurrent * 1000, 2), " ms\n"; echo "case new: ", round($deltaNew * 1000, 2), " ms\n"; echo "new gain: ", round($deltaNew * 100 / $deltaCurrent - 100, 2), " %\n";

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)
7.4.00.0000.02215.02
7.3.120.0120.00914.88
7.3.110.0070.01314.84
7.3.100.0070.01115.04
7.3.90.0100.00714.82
7.3.80.0030.00814.96
7.3.70.0030.01415.00
7.3.60.0060.01314.98
7.3.50.0030.01214.90
7.3.40.0090.00614.86
7.3.30.0060.01214.60
7.3.20.0070.01016.55
7.3.10.0080.00816.50
7.3.00.0070.00716.79
7.2.250.0040.01815.18
7.2.240.0040.01514.87
7.2.230.0070.01015.07
7.2.220.0130.00314.99
7.2.210.0100.00615.24
7.2.200.0060.01215.17
7.2.190.0120.00914.96
7.2.180.0100.00315.12
7.2.170.0070.01015.02
7.2.160.0040.01115.22
7.2.150.0110.00616.93
7.2.140.0070.01016.78
7.2.130.0070.01017.00
7.2.120.0050.01116.74
7.2.110.0060.01016.75
7.2.100.0100.00716.84
7.2.90.0100.00716.74
7.2.80.0070.01216.67
7.2.70.0110.00317.04
7.2.60.0070.00916.84
7.2.50.0030.01216.99
7.2.40.0070.01216.87
7.2.30.0030.01416.99
7.2.20.0070.01016.93
7.2.10.0050.01016.92
7.2.00.0040.01317.81
7.1.330.0070.01415.66
7.1.320.0030.01415.77
7.1.310.0030.01215.70
7.1.300.0060.00615.81
7.1.290.0060.00915.91
7.1.280.0070.01015.85
7.1.270.0070.01115.74
7.1.260.0030.01415.61
7.1.250.0060.01015.87
7.1.240.0050.01015.78
7.1.230.0080.00715.52
7.1.220.0060.01215.77
7.1.210.0060.01015.77
7.1.200.0090.00915.65
7.1.190.0070.00815.81
7.1.180.0060.01115.68
7.1.170.0040.01215.67
7.1.160.0050.01015.86
7.1.150.0030.01415.68
7.1.140.0010.01115.92
7.1.130.0060.01015.94
7.1.120.0050.00815.93
7.1.110.0030.01015.75
7.1.100.0080.00915.54
7.1.90.0050.01315.81
7.1.80.0050.01215.83
7.1.70.0050.00816.25
7.1.60.0070.01217.08
7.1.50.0080.01016.28
7.1.40.0070.00815.82
7.1.30.0080.00615.81
7.1.20.0060.00915.87
7.1.10.0070.00915.78
7.1.00.0080.02818.05
7.0.330.0070.01015.50
7.0.320.0040.01215.55
7.0.310.0060.01015.42
7.0.300.0070.00715.44
7.0.290.0080.00715.53
7.0.280.0060.01015.46
7.0.270.0020.01315.49
7.0.260.0080.00815.36
7.0.250.0030.01415.54
7.0.240.0030.01015.42
7.0.230.0040.01215.23
7.0.220.0050.01015.48
7.0.210.0020.01115.47
7.0.200.0050.00915.88
7.0.190.0040.00915.23
7.0.180.0060.01115.52
7.0.170.0080.00915.35
7.0.160.0050.00915.48
7.0.150.0090.00715.49
7.0.140.0070.03117.55
7.0.130.0070.00715.31
7.0.120.0080.00815.51
7.0.110.0130.03016.96
7.0.100.0110.03016.86
7.0.90.0100.03616.97
7.0.80.0140.02716.99
7.0.70.0070.03416.94
7.0.60.0080.03316.83
7.0.50.0080.03717.06
7.0.40.0060.01815.77
7.0.30.0080.02215.67
7.0.20.0040.02015.71
7.0.10.0060.02015.76
7.0.00.0050.02215.76
5.6.400.0090.01214.38
5.6.390.0070.01714.58
5.6.380.0080.01214.32
5.6.370.0050.01614.58
5.6.360.0070.01114.33
5.6.350.0030.01614.61
5.6.340.0040.01514.53
5.6.330.0020.01914.23
5.6.320.0080.01214.37
5.6.310.0060.01514.38
5.6.300.0060.01314.52
5.6.290.0090.00814.60
5.6.280.0090.03316.46
5.6.270.0100.00914.11
5.6.260.0070.02516.48
5.6.250.0100.03416.42
5.6.240.0050.03716.48
5.6.230.0090.03516.41
5.6.220.0070.03416.48
5.6.210.0100.03316.57
5.6.200.0100.03616.67
5.6.190.0050.03916.47
5.6.180.0070.02716.64
5.6.170.0070.02916.58
5.6.160.0060.02716.54
5.6.150.0070.02216.64
5.6.140.0050.02616.53
5.6.130.0070.02916.66
5.6.120.0020.02616.68
5.6.110.0040.03416.66
5.6.100.0050.02216.58
5.6.90.0040.02816.63
5.6.80.0030.02716.33
5.6.70.0040.02816.36
5.6.60.0010.02916.33
5.6.50.0050.02416.20
5.6.40.0050.03216.40
5.6.30.0060.02116.41
5.6.20.0040.02516.31
5.6.10.0050.02216.36
5.6.00.0050.04116.32
5.5.380.0030.03015.38
5.5.370.0050.03215.39
5.5.360.0090.03215.30
5.5.350.0060.03715.31
5.5.340.0030.03815.53
5.5.330.0070.03315.35
5.5.320.0060.04015.45
5.5.310.0060.03715.53
5.5.300.0060.02815.57
5.5.290.0080.02115.45
5.5.280.0100.02015.41
5.5.270.0080.02715.43
5.5.260.0060.03815.32
5.5.250.0030.02515.46
5.5.240.0080.02815.22
5.5.230.0030.03015.08
5.5.220.0050.02315.15
5.5.210.0060.03115.23
5.5.200.0070.02215.17
5.5.190.0040.02515.08
5.5.180.0040.02215.36
5.5.170.0090.01114.25
5.5.160.0060.03615.19
5.5.150.0080.03715.25
5.5.140.0060.03715.24
5.5.130.0090.03415.27
5.5.120.0050.03515.24
5.5.110.0100.03315.32
5.5.100.0060.03715.24
5.5.90.0070.02714.94
5.5.80.0080.03715.13
5.5.70.0070.03715.20
5.5.60.0030.04015.17
5.5.50.0040.03315.17
5.5.40.0110.03115.20
5.5.30.0090.03215.12
5.5.20.0080.02415.18
5.5.10.0080.03515.30
5.5.00.0070.03215.13
5.4.450.0050.02213.92
5.4.440.0040.02413.99
5.4.430.0060.02814.00
5.4.420.0020.03813.89
5.4.410.0060.02313.82
5.4.400.0010.02513.76
5.4.390.0040.02013.84
5.4.380.0070.02013.76
5.4.370.0000.02813.74
5.4.360.0030.02313.86
5.4.350.0050.02213.75
5.4.340.0050.03713.77
5.4.330.0030.01511.07
5.4.320.0020.03313.73
5.4.310.0060.03313.82
5.4.300.0050.02413.79
5.4.290.0010.03913.82
5.4.280.0060.03513.79
5.4.270.0080.03513.79
5.4.260.0080.03013.81
5.4.250.0050.03613.71
5.4.240.0030.03713.79
5.4.230.0070.03213.74
5.4.220.0040.03313.71
5.4.210.0060.03513.83
5.4.200.0050.03713.76
5.4.190.0050.03313.81
5.4.180.0010.04013.71
5.4.170.0040.03713.89
5.4.160.0100.02413.80
5.4.150.0070.03513.72
5.4.140.0050.03412.99
5.4.130.0030.03212.95
5.4.120.0080.03012.93
5.4.110.0050.03112.94
5.4.100.0040.03412.94
5.4.90.0070.02912.90
5.4.80.0020.03812.95
5.4.70.0080.02912.94
5.4.60.0030.03412.89
5.4.50.0070.02912.87
5.4.40.0030.03412.86
5.4.30.0050.03412.85
5.4.20.0030.03212.89
5.4.10.0030.03912.92
5.4.00.0070.03612.71
5.3.290.0020.02612.27
5.3.280.0040.03012.28
5.3.270.0040.03812.30
5.3.260.0070.03412.27
5.3.250.0020.03412.22
5.3.240.0040.03312.28
5.3.230.0040.03512.29
5.3.220.0020.03712.30
5.3.210.0020.04012.26
5.3.200.0070.03612.28
5.3.190.0030.03612.31
5.3.180.0030.03412.28
5.3.170.0030.04012.31
5.3.160.0080.03712.27
5.3.150.0080.02612.26
5.3.140.0050.03612.28
5.3.130.0060.03812.27
5.3.120.0070.03212.25
5.3.110.0040.03712.25
5.3.100.0050.03712.06
5.3.90.0070.03412.07
5.3.80.0040.03412.12
5.3.70.0070.03412.05
5.3.60.0070.03512.05
5.3.50.0060.03712.02
5.3.40.0030.03112.04
5.3.30.0080.03412.03
5.3.20.0040.03811.99
5.3.10.0030.03611.93
5.3.00.0000.03712.00
5.2.170.0050.04011.42
5.2.160.0030.03611.42
5.2.150.0080.04011.42
5.2.140.0090.03711.42
5.2.130.0030.04011.42
5.2.120.0030.04011.42
5.2.110.0020.04711.42
5.2.100.0050.04111.42
5.2.90.0070.03711.42
5.2.80.0030.04511.42
5.2.70.0020.04611.42
5.2.60.0030.04011.42
5.2.50.0080.03611.42
5.2.40.0060.04111.42
5.2.30.0070.03811.42
5.2.20.0080.02311.42
5.2.10.0060.03611.42
5.2.00.0020.04311.42
5.1.60.0020.04111.42
5.1.50.0050.03011.42
5.1.40.0130.03111.42
5.1.30.0070.03511.42
5.1.20.0050.02611.42
5.1.10.0050.03611.42
5.1.00.0050.03811.42
5.0.50.0050.03511.42
5.0.40.0000.02511.42
5.0.30.0050.04311.42
5.0.20.0020.03511.42
5.0.10.0030.03411.42
5.0.00.0050.02811.42
4.4.90.0000.03211.42
4.4.80.0020.03211.42
4.4.70.0020.03111.42
4.4.60.0020.02811.42
4.4.50.0020.03111.42
4.4.40.0020.04011.42
4.4.30.0030.02711.42
4.4.20.0070.03011.42
4.4.10.0050.02711.42
4.4.00.0050.03211.42
4.3.110.0020.02511.42
4.3.100.0030.03211.42
4.3.90.0050.02811.42
4.3.80.0030.03011.42
4.3.70.0030.02611.42
4.3.60.0020.02811.42
4.3.50.0020.02811.42
4.3.40.0070.03211.42
4.3.30.0050.02611.42
4.3.20.0020.02811.42
4.3.10.0020.03211.42
4.3.00.0030.02511.42

preferences:
43.69 ms | 401 KiB | 5 Q