3v4l.org

run code in 300+ PHP versions simultaneously
<?php $i=0; $time = microtime(true); while($i < 50) { $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 < 50) { $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.3.00.0100.00716.91
7.2.130.0120.00317.11
7.2.120.0100.00717.18
7.2.110.0030.01316.89
7.2.100.0080.00317.27
7.2.90.0000.01117.07
7.2.80.0040.01116.89
7.2.70.0040.00717.07
7.2.60.0070.01116.95
7.2.50.0090.00917.22
7.2.40.0080.00817.18
7.2.30.0130.00317.23
7.2.20.0040.01117.14
7.2.10.0080.00417.14
7.2.00.0100.00718.26
7.1.250.0070.00715.95
7.1.240.0100.00716.11
7.1.230.0070.00715.92
7.1.220.0050.00315.91
7.1.210.0030.01015.86
7.1.200.0070.00715.78
7.1.190.0060.00616.07
7.1.180.0000.01315.86
7.1.170.0040.00816.18
7.1.160.0030.01015.98
7.1.150.0090.00616.00
7.1.140.0030.01415.94
7.1.130.0040.01116.05
7.1.120.0100.00715.89
7.1.110.0030.00515.83
7.1.100.0000.01216.09
7.1.90.0130.00316.06
7.1.80.0080.00515.79
7.1.70.0010.00916.63
7.1.60.0080.01017.63
7.1.50.0150.01125.53
7.1.40.0100.00715.95
7.1.30.0060.00616.00
7.1.20.0070.01115.98
7.1.10.0100.00316.01
7.1.00.0050.04019.17
7.0.330.0030.00615.54
7.0.320.0030.01015.67
7.0.310.0000.01315.38
7.0.300.0110.00015.56
7.0.290.0090.00615.44
7.0.280.0000.01515.54
7.0.270.0060.00615.46
7.0.260.0030.01015.68
7.0.250.0060.00615.43
7.0.240.0030.01015.78
7.0.230.0000.00815.52
7.0.220.0090.00615.61
7.0.210.0090.00615.57
7.0.200.0050.00716.26
7.0.190.0030.00615.66
7.0.180.0060.00615.26
7.0.170.0040.01115.73
7.0.160.0080.00615.42
7.0.150.0080.00815.70
7.0.140.0040.04218.77
7.0.130.0030.00615.59
7.0.120.0020.03818.90
7.0.110.0130.00315.28
7.0.100.0080.00415.73
7.0.90.0000.01215.43
7.0.80.0040.00415.56
7.0.70.0060.00615.54
7.0.60.0030.03017.67
7.0.50.0020.02616.64
7.0.40.0040.02517.04
7.0.30.0150.02516.96
7.0.20.0120.03116.69
7.0.10.0080.04416.59
7.0.00.0050.03016.90
5.6.380.0070.01314.37
5.6.370.0030.00914.53
5.6.360.0070.00714.79
5.6.350.0060.00614.71
5.6.340.0070.01114.34
5.6.330.0000.01014.45
5.6.320.0060.00814.66
5.6.310.0130.00014.80
5.6.300.0100.00714.14
5.6.290.0090.00614.32
5.6.280.0040.04317.79
5.6.270.0060.00314.63
5.6.260.0070.00714.52
5.6.250.0070.00714.52
5.6.240.0000.01414.32
5.6.230.0040.00814.66
5.6.220.0120.00314.28
5.6.210.0020.03017.45
5.6.200.0080.04516.49
5.6.190.0080.04617.26
5.6.180.0190.04617.57
5.6.170.0130.04517.35
5.6.160.0080.03117.45
5.6.150.0030.02716.29
5.6.140.0080.02816.44
5.6.130.0070.04316.31
5.6.120.0040.05117.91
5.6.110.0020.05217.62
5.6.100.0100.04117.79
5.6.90.0050.04017.81
5.6.80.0080.04417.57
5.6.70.0070.01114.40
5.6.60.0060.00614.32
5.6.50.0000.00914.36
5.6.40.0080.00414.38
5.6.30.0090.00914.13
5.6.20.0030.01014.54
5.6.10.0030.01614.46
5.6.00.0030.01314.52
5.5.380.0070.00311.16
5.5.370.0120.00011.35
5.5.360.0000.00811.05
5.5.350.0210.03615.81
5.5.340.0080.02814.64
5.5.330.0100.04015.90
5.5.320.0070.02615.81
5.5.310.0150.02515.75
5.5.300.0050.04214.54
5.5.290.0070.04014.53
5.5.280.0050.04516.16
5.5.270.0020.02416.19
5.5.260.0080.04515.99
5.5.250.0090.03415.88
5.5.240.0100.03515.66
5.5.230.0000.01211.30
5.5.220.0060.00611.19
5.5.210.0030.00911.04
5.5.200.0070.00311.22
5.5.190.0020.00511.27
5.5.180.0040.00411.30
5.5.170.0040.00811.13
5.5.160.0000.01411.19
5.5.150.0040.00711.21
5.5.140.0060.00611.00
5.5.130.0040.01110.96
5.5.120.0030.00711.20
5.5.110.0080.00311.15
5.5.100.0030.00611.07
5.5.90.0050.00311.05
5.5.80.0030.00611.26
5.5.70.0060.00611.07
5.5.60.0060.00311.10
5.5.50.0040.00411.15
5.5.40.0030.00711.21
5.5.30.0060.00611.33
5.5.20.0030.00611.23
5.5.10.0090.00311.26
5.5.00.0030.00911.03
5.4.450.0020.02315.13
5.4.440.0010.02615.27
5.4.430.0020.04515.17
5.4.420.0030.02815.27
5.4.410.0060.04314.93
5.4.400.0030.04215.13
5.4.390.0030.02615.06
5.4.380.0070.03514.91
5.4.370.0050.02515.18
5.4.360.0030.03014.87
5.4.350.0060.04314.96
5.4.340.0070.02314.98
5.4.330.0030.00810.59
5.4.320.0080.02014.96
5.4.310.0030.03515.05
5.4.300.0020.02414.89
5.4.290.0050.02414.85
5.4.280.0060.02315.11
5.4.270.0040.02015.18
5.4.260.0050.02215.07
5.4.250.0020.02714.97
5.4.240.0080.02014.98
5.4.230.0080.02015.01
5.4.220.0030.02215.11
5.4.210.0030.02315.18
5.4.200.0020.02915.14
5.4.190.0050.03614.97
5.4.180.0020.03915.10
5.4.170.0060.04115.07
5.4.160.0110.03615.13
5.4.150.0090.03514.94
5.4.140.0090.03813.71
5.4.130.0050.02913.68
5.4.120.0070.03513.70
5.4.110.0080.04013.54
5.4.100.0090.03713.84
5.4.90.0080.02813.76
5.4.80.0050.03313.72
5.4.70.0040.02413.72
5.4.60.0050.03113.65
5.4.50.0020.03013.71
5.4.40.0050.04113.74
5.4.30.0000.02913.64
5.4.20.0080.03813.67
5.4.10.0020.04113.63
5.4.00.0050.04113.35
5.3.290.0040.02112.66
5.3.280.0000.02512.36
5.3.270.0000.03812.55
5.3.260.0070.02512.62
5.3.250.0060.03912.51
5.3.240.0080.02412.43
5.3.230.0100.02412.54
5.3.220.0050.04312.49
5.3.210.0040.04312.47
5.3.200.0080.04312.57
5.3.190.0050.02612.35
5.3.180.0030.03512.54
5.3.170.0030.02312.62
5.3.160.0080.02512.64
5.3.150.0060.03812.54
5.3.140.0060.04012.47
5.3.130.0020.03512.54
5.3.120.0080.03912.59
5.3.110.0050.02712.52
5.3.100.0020.02912.29
5.3.90.0050.03712.27
5.3.80.0020.03512.20
5.3.70.0050.02212.16
5.3.60.0060.02612.21
5.3.50.0040.02412.17
5.3.40.0090.03612.17
5.3.30.0040.03112.09
5.3.20.0080.03911.95
5.3.10.0000.02811.84
5.3.00.0060.01811.97
5.2.170.0030.02410.51
5.2.160.0070.02010.41
5.2.150.0030.03610.45
5.2.140.0050.02310.41
5.2.130.0060.01810.40
5.2.120.0020.02410.49
5.2.110.0010.02110.37
5.2.100.0020.02210.26
5.2.90.0050.03210.47
5.2.80.0030.02010.34
5.2.70.0030.02010.38
5.2.60.0020.04310.29
5.2.50.0010.02310.16
5.2.40.0080.03110.34
5.2.30.0070.02710.20
5.2.20.0030.02510.21
5.2.10.0000.0369.94
5.2.00.0050.03310.05
5.1.60.0080.0209.38
5.1.50.0050.0309.31
5.1.40.0060.0239.26
5.1.30.0020.0229.74
5.1.20.0060.0149.68
5.1.10.0000.0259.32
5.1.00.0070.0199.54
5.0.50.0070.0138.94
5.0.40.0070.0258.94
5.0.30.0020.0248.94
5.0.20.0030.0198.94
5.0.10.0080.0238.94
5.0.00.0020.0238.94
4.4.90.0020.0138.94
4.4.80.0050.0208.94
4.4.70.0030.0108.94
4.4.60.0020.0138.94
4.4.50.0030.0178.94
4.4.40.0020.0288.94
4.4.30.0030.0138.94
4.4.20.0010.0128.94
4.4.10.0070.0188.94
4.4.00.0020.0178.94
4.3.110.0030.0168.94
4.3.100.0000.0208.94
4.3.90.0020.0198.94
4.3.80.0000.0168.94
4.3.70.0020.0178.94
4.3.60.0000.0138.94
4.3.50.0000.0158.94
4.3.40.0000.0218.94
4.3.30.0000.0148.94
4.3.20.0000.0248.94
4.3.10.0030.0158.94
4.3.00.0000.0208.94

preferences:
41.64 ms | 401 KiB | 5 Q