3v4l.org

run code in 300+ PHP versions simultaneously
<?php $i=0; $time = microtime(true); while($i < 500) { $i++; @preg_replace('/(^|[a-z])([A-Z])/e', 'strtolower(strlen("\\1") ? "\\1_\\2" : "\\2")', 'VeryLongClassName'); } $time = microtime(true) - $time; echo '1: ' . number_format($time, 3) ."\n"; $i=0; $time = microtime(true); while($i < 500) { $i++; @preg_replace('/(?!^)[[:upper:]][[:lower:]]/', '$0', preg_replace('/(?!^)[[:upper:]]+/', '_'.'$0', 'VeryLongClassName')); } $time = microtime(true) - $time; echo '2: ' . number_format($time, 3) ."\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.10.0160.00315.16
7.4.00.0070.01014.90
7.3.130.0090.00914.86
7.3.120.0030.01115.14
7.3.110.0160.00315.14
7.3.100.0040.01215.32
7.3.90.0000.01415.07
7.3.80.0020.01415.19
7.3.70.0060.00914.85
7.3.60.0000.01414.95
7.3.50.0090.00615.13
7.3.40.0100.00614.79
7.3.30.0000.01214.82
7.3.20.0100.00316.79
7.3.10.0120.00316.75
7.3.00.0050.00716.71
7.2.260.0060.01215.30
7.2.250.0000.02115.33
7.2.240.0060.01315.39
7.2.230.0060.01315.37
7.2.220.0070.00415.50
7.2.210.0040.00815.20
7.2.200.0070.01015.39
7.2.190.0060.01015.39
7.2.180.0000.01214.94
7.2.170.0100.00314.95
7.2.160.0000.01315.32
7.2.150.0060.00917.11
7.2.140.0100.01017.16
7.2.130.0080.00617.05
7.2.120.0100.00616.86
7.2.110.0050.00616.88
7.2.100.0050.01017.15
7.2.90.0030.01217.20
7.2.80.0070.00817.17
7.2.70.0020.01017.25
7.2.60.0070.01217.11
7.2.50.0070.01017.18
7.2.40.0050.01317.02
7.2.30.0020.01317.13
7.2.20.0040.01117.08
7.2.10.0080.00916.99
7.2.00.0060.00817.75
7.1.330.0000.01716.17
7.1.320.0070.01116.04
7.1.310.0030.01016.09
7.1.300.0030.01416.09
7.1.290.0030.00916.04
7.1.280.0000.01515.98
7.1.270.0030.00915.86
7.1.260.0000.01115.78
7.1.250.0030.01015.93
7.1.240.0040.00715.80
7.1.230.0100.00215.85
7.1.220.0030.01015.88
7.1.210.0020.01116.03
7.1.200.0020.01315.92
7.1.190.0030.01215.98
7.1.180.0120.00515.89
7.1.170.0060.01015.88
7.1.160.0040.01115.79
7.1.150.0100.00715.93
7.1.140.0040.01116.01
7.1.130.0020.01015.82
7.1.120.0060.01115.88
7.1.110.0130.00516.12
7.1.100.0050.00516.02
7.1.90.0050.01016.19
7.1.80.0070.00815.73
7.1.70.0050.00616.52
7.1.60.0100.00817.06
7.1.50.0100.00816.44
7.1.40.0030.01416.07
7.1.30.0070.00616.02
7.1.20.0070.00816.17
7.1.10.0080.01015.93
7.1.00.0040.02518.05
7.0.330.0050.00815.28
7.0.320.0020.01215.46
7.0.310.0050.00815.60
7.0.300.0060.00715.68
7.0.290.0050.00815.75
7.0.280.0040.01115.48
7.0.270.0050.01015.52
7.0.260.0080.00815.72
7.0.250.0080.00915.65
7.0.240.0020.01115.63
7.0.230.0100.00415.43
7.0.220.0030.00815.66
7.0.210.0030.00915.65
7.0.200.0110.00915.38
7.0.190.0070.00815.46
7.0.180.0050.00815.68
7.0.170.0070.00715.50
7.0.160.0040.00715.45
7.0.150.0000.01315.56
7.0.140.0050.02917.76
7.0.130.0050.00915.73
7.0.120.0080.02817.73
7.0.110.0020.01015.54
7.0.100.0060.00815.59
7.0.90.0060.00315.60
7.0.80.0080.00615.57
7.0.70.0050.01015.51
7.0.60.0050.03217.07
7.0.50.0060.02516.41
7.0.40.0060.03415.79
7.0.30.0040.02415.79
7.0.20.0060.02415.74
7.0.10.0040.02115.99
7.0.00.0070.03215.76
5.6.400.0060.02214.77
5.6.390.0000.02514.96
5.6.380.0080.02014.64
5.6.370.0020.02714.76
5.6.360.0050.02414.45
5.6.350.0030.02714.91
5.6.340.0110.01914.77
5.6.330.0030.02714.65
5.6.320.0080.02014.89
5.6.310.0090.01714.67
5.6.300.0050.02514.66
5.6.290.0050.02714.79
5.6.280.0020.04916.88
5.6.270.0070.02214.62
5.6.260.0050.02214.63
5.6.250.0020.02414.80
5.6.240.0080.01614.76
5.6.230.0060.02814.58
5.6.220.0070.02114.68
5.6.210.0060.03616.59
5.6.200.0060.03915.93
5.6.190.0040.04616.56
5.6.180.0080.03416.56
5.6.170.0030.03516.58
5.6.160.0080.03216.68
5.6.150.0080.04416.50
5.6.140.0070.04216.64
5.6.130.0020.03616.68
5.6.120.0070.04516.56
5.6.110.0060.05116.67
5.6.100.0070.04516.52
5.6.90.0110.04216.67
5.6.80.0030.04816.43
5.6.70.0060.04116.28
5.6.60.0060.04916.24
5.6.50.0070.04716.20
5.6.40.0050.04616.22
5.6.30.0010.03816.25
5.6.20.0060.04416.36
5.6.10.0070.03516.23
5.6.00.0090.04016.33
5.5.380.0000.02512.83
5.5.370.0030.02412.89
5.5.360.0060.01913.03
5.5.350.0110.04515.60
5.5.340.0070.04614.57
5.5.330.0070.04715.46
5.5.320.0050.03415.43
5.5.310.0030.03215.41
5.5.300.0010.03515.46
5.5.290.0060.04815.25
5.5.280.0100.04115.34
5.5.270.0100.04515.45
5.5.260.0050.03915.38
5.5.250.0020.04815.12
5.5.240.0050.03315.15
5.5.230.0050.03815.19
5.5.220.0070.04515.02
5.5.210.0060.04514.99
5.5.200.0050.03115.13
5.5.190.0010.04015.05
5.5.180.0020.04815.02
5.5.170.0050.01912.68
5.5.160.0040.04415.03
5.5.150.0060.04515.19
5.5.140.0070.03615.01
5.5.130.0060.03315.16
5.5.120.0040.04715.12
5.5.110.0020.03515.14
5.5.100.0020.03615.17
5.5.90.0040.03014.99
5.5.80.0040.03115.09
5.5.70.0080.02615.05
5.5.60.0080.03815.10
5.5.50.0050.03014.88
5.5.40.0020.03615.09
5.5.30.0040.03115.06
5.5.20.0060.03714.98
5.5.10.0020.03415.01
5.5.00.0120.03715.13
5.4.450.0030.03514.21
5.4.440.0040.04814.12
5.4.430.0050.04114.19
5.4.420.0070.03214.16
5.4.410.0030.03914.19
5.4.400.0050.03114.09
5.4.390.0020.04314.04
5.4.380.0080.04514.06
5.4.370.0040.03414.04
5.4.360.0070.03914.11
5.4.350.0070.04414.12
5.4.340.0020.04614.12
5.4.330.0060.01411.65
5.4.320.0030.04214.15
5.4.310.0020.04214.10
5.4.300.0030.04414.01
5.4.290.0050.03313.98
5.4.280.0040.03514.09
5.4.270.0020.04814.15
5.4.260.0070.04314.14
5.4.250.0040.02913.99
5.4.240.0030.03513.99
5.4.230.0030.03113.93
5.4.220.0030.03213.95
5.4.210.0090.02713.93
5.4.200.0060.04413.95
5.4.190.0040.02814.06
5.4.180.0050.03014.09
5.4.170.0060.03214.08
5.4.160.0070.03614.01
5.4.150.0060.03313.93
5.4.140.0010.03413.11
5.4.130.0020.02913.12
5.4.120.0060.02813.27
5.4.110.0060.04213.21
5.4.100.0060.04113.05
5.4.90.0070.04313.15
5.4.80.0050.03713.08
5.4.70.0080.02813.16
5.4.60.0060.04213.25
5.4.50.0080.04213.04
5.4.40.0050.02913.17
5.4.30.0040.03213.20
5.4.20.0010.03713.13
5.4.10.0070.02813.24
5.4.00.0080.03812.95
5.3.290.0020.04212.33
5.3.280.0020.04212.28
5.3.270.0080.03912.36
5.3.260.0040.03912.31
5.3.250.0030.04012.32
5.3.240.0030.03412.21
5.3.230.0040.02812.34
5.3.220.0090.03212.21
5.3.210.0060.02912.27
5.3.200.0040.04412.22
5.3.190.0040.03312.22
5.3.180.0090.03012.35
5.3.170.0090.03512.31
5.3.160.0010.03412.23
5.3.150.0070.04612.33
5.3.140.0040.04012.32
5.3.130.0010.04712.21
5.3.120.0110.03512.29
5.3.110.0040.02512.27
5.3.100.0040.04412.09
5.3.90.0040.03312.09
5.3.80.0060.03711.99
5.3.70.0040.04311.96
5.3.60.0030.03512.07
5.3.50.0020.03612.03
5.3.40.0050.03712.08
5.3.30.0060.02312.06
5.3.20.0030.04311.99
5.3.10.0010.03411.88
5.3.00.0080.03411.88
5.2.170.0070.04010.44
5.2.160.0030.04710.47
5.2.150.0030.03810.42
5.2.140.0050.04310.46
5.2.130.0020.04410.25
5.2.120.0020.03810.31
5.2.110.0050.04010.39
5.2.100.0070.04710.48
5.2.90.0030.02910.31
5.2.80.0030.04410.34
5.2.70.0050.03410.43
5.2.60.0030.04610.29
5.2.50.0070.03710.30
5.2.40.0070.04410.35
5.2.30.0020.03610.29
5.2.20.0030.03110.26
5.2.10.0050.04310.28
5.2.00.0020.03210.21
5.1.60.0030.0429.33
5.1.50.0080.0319.48
5.1.40.0020.0389.38
5.1.30.0020.0319.70
5.1.20.0020.0399.75
5.1.10.0020.0389.62
5.1.00.0020.0449.37
5.0.50.0030.0388.44
5.0.40.0020.0278.29
5.0.30.0070.0458.21
5.0.20.0000.0428.24
5.0.10.0030.0338.25
5.0.00.0050.0348.18
4.4.90.0030.0327.92
4.4.80.0050.0307.92
4.4.70.0000.0347.92
4.4.60.0030.0277.92
4.4.50.0050.0347.92
4.4.40.0030.0317.92
4.4.30.0000.0297.92
4.4.20.0020.0207.92
4.4.10.0020.0317.92
4.4.00.0020.0287.92
4.3.110.0000.0357.92
4.3.100.0000.0287.92
4.3.90.0000.0287.92
4.3.80.0030.0337.92
4.3.70.0030.0197.92
4.3.60.0020.0197.92
4.3.50.0020.0337.92
4.3.40.0050.0287.92
4.3.30.0020.0367.92
4.3.20.0020.0347.92
4.3.10.0020.0387.92
4.3.00.0020.0367.92

preferences:
33.01 ms | 400 KiB | 5 Q