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.2.00.0000.01219.53
7.1.70.0000.00817.49
7.1.60.0060.01919.40
7.1.50.0070.01417.21
7.1.00.0000.08022.55
7.0.200.0080.00316.89
7.0.140.0000.07722.00
7.0.120.0070.07022.04
7.0.60.0030.08719.93
7.0.50.0030.04018.11
7.0.40.0070.06320.13
7.0.30.0470.06320.11
7.0.20.0370.07320.30
7.0.10.0470.07020.10
7.0.00.0030.04720.00
5.6.280.0000.08021.14
5.6.210.0100.08020.50
5.6.200.0170.04318.22
5.6.190.0170.07720.44
5.6.180.0200.07320.39
5.6.170.0270.09020.57
5.6.160.0070.08720.54
5.6.150.0030.08318.24
5.6.140.0130.04718.19
5.6.130.0070.08018.21
5.6.120.0130.06021.27
5.6.110.0100.03721.06
5.6.100.0200.07021.04
5.6.90.0100.03721.15
5.6.80.0070.05320.50
5.6.70.0230.08020.45
5.5.350.0130.04320.50
5.5.340.0130.07017.98
5.5.330.0070.04020.40
5.5.320.0100.09320.27
5.5.310.0230.06720.21
5.5.300.0030.06717.88
5.5.290.0000.09317.92
5.5.280.0070.04721.00
5.5.270.0200.07720.80
5.5.260.0070.04020.77
5.5.250.0130.06320.74
5.5.240.0030.06020.20
5.4.450.0200.07019.52
5.4.440.0270.07719.63
5.4.430.0230.06019.54
5.4.420.0370.03319.56
5.4.410.0330.06319.42
5.4.400.0300.04019.32
5.4.390.0270.05019.25
5.4.380.0300.06019.31
5.4.370.0170.07318.88
5.4.360.0170.08319.06
5.4.350.0230.04318.99
5.4.340.0270.07019.24
5.4.320.0230.07319.24
5.4.310.0230.04719.14
5.4.300.0230.03719.21
5.4.290.0330.03719.30
5.4.280.0170.07319.10
5.4.270.0300.07019.22
5.4.260.0300.06719.09
5.4.250.0270.03719.21
5.4.240.0270.07318.98
5.4.230.0300.07018.79
5.4.220.0300.06318.91
5.4.210.0200.05718.91
5.4.200.0200.04719.09
5.4.190.0230.07319.07
5.4.180.0200.07719.07
5.4.170.0330.06019.16
5.4.160.0200.04319.04
5.4.150.0200.04319.20
5.4.140.0400.05316.49
5.4.130.0300.07316.33
5.4.120.0200.05316.34
5.4.110.0230.04716.44
5.4.100.0200.05016.32
5.4.90.0200.07716.52
5.4.80.0270.06716.51
5.4.70.0200.04016.43
5.4.60.0300.07016.37
5.4.50.0230.07316.48
5.4.40.0300.06716.48
5.4.30.0300.04016.14
5.4.20.0300.06316.48
5.4.10.0170.05716.15
5.4.00.0070.05715.89
5.3.290.0230.05314.57
5.3.280.0270.06314.50
5.3.270.0300.06014.56
5.3.260.0300.06314.56
5.3.250.0270.05314.58
5.3.240.0230.07014.52
5.3.230.0230.07314.53
5.3.220.0200.06314.52
5.3.210.0270.06014.55
5.3.200.0170.04314.52
5.3.190.0130.05314.52
5.3.180.0270.05014.48
5.3.170.0200.04014.54
5.3.160.0400.05014.40
5.3.150.0170.04014.41
5.3.140.0300.03714.45
5.3.130.0430.03714.48
5.3.120.0270.05014.44
5.3.110.0230.04314.54
5.3.100.0070.05314.02
5.3.90.0200.07014.00
5.3.80.0230.07013.94
5.3.70.0230.07014.11
5.3.60.0270.05013.99
5.3.50.0200.04713.82
5.3.40.0170.06013.89
5.3.30.0330.06013.86
5.3.20.0330.06313.60
5.3.10.0200.07313.46
5.3.00.0230.05713.58
5.2.170.0230.06013.22
5.2.160.0230.05013.22
5.2.150.0230.05713.22
5.2.140.0200.06313.22
5.2.130.0200.05313.22
5.2.120.0230.03313.22
5.2.110.0130.05313.22
5.2.100.0170.02713.22
5.2.90.0100.04013.22
5.2.80.0200.06013.22
5.2.70.0200.04013.22
5.2.60.0270.04013.22
5.2.50.0230.06013.22
5.2.40.0130.05713.22
5.2.30.0200.03313.22
5.2.20.0130.04713.22
5.2.10.0200.05713.22
5.2.00.0170.05313.22
5.1.60.0170.04013.22
5.1.50.0130.04313.22
5.1.40.0200.04013.22
5.1.30.0200.03313.22
5.1.20.0200.04713.22
5.1.10.0130.04313.22
5.1.00.0130.02713.22
5.0.50.0200.02013.22
5.0.40.0100.03713.22
5.0.30.0100.06713.22
5.0.20.0070.04313.22
5.0.10.0070.03013.22
5.0.00.0100.04013.22
4.4.90.0070.03013.22
4.4.80.0100.03313.22
4.4.70.0070.02713.22
4.4.60.0070.02313.22
4.4.50.0100.03713.22
4.4.40.0070.04713.22
4.4.30.0130.02313.22
4.4.20.0100.03313.22
4.4.10.0130.02313.22
4.4.00.0070.03013.22
4.3.110.0100.02013.22
4.3.100.0070.03713.22
4.3.90.0100.02713.22
4.3.80.0070.03013.22
4.3.70.0030.02313.22
4.3.60.0070.02013.22
4.3.50.0130.03013.22
4.3.40.0100.03013.22
4.3.30.0100.03313.22
4.3.20.0030.02713.22
4.3.10.0070.02013.22
4.3.00.0000.02713.22

preferences:
32.52 ms | 401 KiB | 5 Q