3v4l.org

run code in 300+ PHP versions simultaneously
<?php $i=0; $time = microtime(true); while($i < 5000) { $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 < 5000) { $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.0100.02115.29
7.4.00.0080.02415.18
7.3.130.0090.01515.19
7.3.120.0070.02215.01
7.3.110.0080.02115.12
7.3.100.0070.01714.95
7.3.90.0040.01915.02
7.3.80.0070.01715.21
7.3.70.0090.01415.02
7.3.60.0060.01715.10
7.3.50.0080.01814.99
7.3.40.0060.02015.03
7.3.30.0080.01714.94
7.3.20.0010.02216.75
7.3.10.0100.01316.88
7.3.00.0060.01816.93
7.2.260.0090.01915.02
7.2.250.0050.02415.37
7.2.240.0050.02015.17
7.2.230.0060.01715.22
7.2.220.0070.01915.29
7.2.210.0050.01915.37
7.2.200.0060.01715.25
7.2.190.0080.01615.35
7.2.180.0100.01615.21
7.2.170.0090.01515.24
7.2.160.0030.01715.11
7.2.150.0080.01817.12
7.2.140.0050.01717.01
7.2.130.0030.02217.12
7.2.120.0080.02017.18
7.2.110.0100.01616.97
7.2.100.0100.01617.01
7.2.90.0070.01716.97
7.2.80.0070.01717.13
7.2.70.0160.01517.13
7.2.60.0060.01817.06
7.2.50.0120.01517.17
7.2.40.0080.01717.08
7.2.30.0090.01717.16
7.2.20.0100.01517.04
7.2.10.0060.01717.15
7.2.00.0070.01617.74
7.1.330.0020.02216.02
7.1.320.0080.01816.00
7.1.310.0010.02115.83
7.1.300.0070.01815.97
7.1.290.0020.02115.86
7.1.280.0040.01916.10
7.1.270.0030.02015.88
7.1.260.0060.01815.80
7.1.250.0020.02215.91
7.1.240.0000.03416.00
7.1.230.0080.01615.93
7.1.220.0060.01616.06
7.1.210.0040.01816.04
7.1.200.0020.02216.01
7.1.190.0100.01715.70
7.1.180.0050.01716.09
7.1.170.0060.01916.09
7.1.160.0080.01715.97
7.1.150.0050.01615.84
7.1.140.0060.01715.89
7.1.130.0110.01615.85
7.1.120.0040.01715.93
7.1.110.0150.02016.10
7.1.100.0070.01815.97
7.1.90.0150.01215.89
7.1.80.0090.01415.90
7.1.70.0030.02216.48
7.1.60.0090.02117.25
7.1.50.0090.02116.41
7.1.40.0040.02016.11
7.1.30.0080.01516.05
7.1.20.0070.01716.00
7.1.10.0020.01916.02
7.1.00.0090.02318.10
7.0.330.0070.01715.26
7.0.320.0000.02315.68
7.0.310.0070.01515.57
7.0.300.0070.01315.66
7.0.290.0050.01615.63
7.0.280.0030.02015.63
7.0.270.0080.01615.54
7.0.260.0120.01115.60
7.0.250.0090.01515.67
7.0.240.0270.01315.68
7.0.230.0170.01915.65
7.0.220.0090.01315.50
7.0.210.0070.01715.59
7.0.200.0040.01516.06
7.0.190.0290.01515.63
7.0.180.0070.01915.75
7.0.170.0070.01515.59
7.0.160.0080.01515.72
7.0.150.0130.00915.58
7.0.140.0050.04017.83
7.0.130.0050.01615.70
7.0.120.0060.01715.53
7.0.110.0080.02015.53
7.0.100.0060.01615.57
7.0.90.0100.03416.94
7.0.80.0190.03717.08
7.0.70.0060.02817.13
7.0.60.0200.04317.12
7.0.50.0100.04017.24
7.0.40.0070.04215.86
7.0.30.0110.03815.87
7.0.20.0070.03415.69
7.0.10.0040.02915.89
7.0.00.0060.03115.80
5.6.400.0000.15014.70
5.6.390.0070.14314.47
5.6.380.0110.11514.55
5.6.370.0080.11814.65
5.6.360.0090.14514.81
5.6.350.0080.13214.60
5.6.340.0070.11814.60
5.6.330.0070.12014.49
5.6.320.0070.12114.62
5.6.310.0070.12014.60
5.6.300.0080.12414.89
5.6.290.0070.13014.83
5.6.280.0080.16916.71
5.6.270.0080.11914.52
5.6.260.0070.12314.66
5.6.250.0050.14314.63
5.6.240.0020.13414.54
5.6.230.0060.13916.62
5.6.220.0060.13216.71
5.6.210.0110.13016.75
5.6.200.0070.13416.95
5.6.190.0100.16116.81
5.6.180.0060.14616.74
5.6.170.0060.12416.79
5.6.160.0080.13316.89
5.6.150.0060.13316.77
5.6.140.0080.14616.90
5.6.130.0070.12516.82
5.6.120.0060.13316.77
5.6.110.0030.13116.88
5.6.100.0060.12916.94
5.6.90.0050.13216.88
5.6.80.0050.14516.49
5.6.70.0070.12716.57
5.6.60.0100.13016.48
5.6.50.0070.16816.59
5.6.40.0100.15216.59
5.6.30.0060.14216.61
5.6.20.0080.13816.62
5.6.10.0100.13516.50
5.6.00.0080.12816.50
5.5.380.0100.12013.82
5.5.370.0090.12816.00
5.5.360.0040.13515.87
5.5.350.0070.14915.95
5.5.340.0060.14116.20
5.5.330.0110.16116.29
5.5.320.0080.14116.08
5.5.310.0090.11816.15
5.5.300.0060.13116.05
5.5.290.0080.13916.11
5.5.280.0060.13016.12
5.5.270.0060.12716.08
5.5.260.0060.12816.13
5.5.250.0070.12516.00
5.5.240.0040.12316.00
5.5.230.0030.13715.94
5.5.220.0070.13315.82
5.5.210.0050.14215.97
5.5.200.0070.14515.96
5.5.190.0090.13715.94
5.5.180.0070.14615.77
5.5.170.0020.14814.43
5.5.160.0040.14115.91
5.5.150.0060.14415.88
5.5.140.0150.13715.93
5.5.130.0090.13215.92
5.5.120.0040.16415.99
5.5.110.0060.14615.83
5.5.100.0060.12615.95
5.5.90.0050.12715.88
5.5.80.0030.14615.91
5.5.70.0090.14215.86
5.5.60.0040.16215.79
5.5.50.0060.15115.87
5.5.40.0070.14115.79
5.5.30.0050.11915.89
5.5.20.0030.13215.74
5.5.10.0070.13915.88
5.5.00.0040.15415.85
5.4.450.0030.11414.60
5.4.440.0060.10614.62
5.4.430.0060.11014.59
5.4.420.0070.11114.60
5.4.410.0060.11014.50
5.4.400.0050.10114.50
5.4.390.0030.10614.49
5.4.380.0060.11014.46
5.4.370.0060.12914.46
5.4.360.0050.11114.43
5.4.350.0030.13314.46
5.4.340.0030.10814.54
5.4.330.0100.10812.14
5.4.320.0020.13414.50
5.4.310.0090.11214.51
5.4.300.0030.10514.42
5.4.290.0070.11514.46
5.4.280.0060.13014.47
5.4.270.0030.12214.53
5.4.260.0080.12414.53
5.4.250.0110.12714.49
5.4.240.0040.13014.47
5.4.230.0090.12714.53
5.4.220.0070.13914.47
5.4.210.0080.11514.49
5.4.200.0100.11814.48
5.4.190.0030.11514.48
5.4.180.0060.12614.50
5.4.170.0080.12314.46
5.4.160.0070.12914.53
5.4.150.0060.12714.48
5.4.140.0050.11813.60
5.4.130.0150.11713.56
5.4.120.0060.10613.54
5.4.110.0030.14113.61
5.4.100.0050.14313.58
5.4.90.0070.10913.58
5.4.80.0100.12313.65
5.4.70.0060.12613.58
5.4.60.0020.12113.61
5.4.50.0030.13613.55
5.4.40.0080.13313.57
5.4.30.0040.10913.58
5.4.20.0040.11513.57
5.4.10.0090.11613.56
5.4.00.0020.10613.41
5.3.290.0040.11712.96
5.3.280.0060.12812.97
5.3.270.0060.10312.95
5.3.260.0110.11212.99
5.3.250.0060.11912.98
5.3.240.0060.10212.93
5.3.230.0070.12512.94
5.3.220.0040.10912.92
5.3.210.0020.11812.97
5.3.200.0040.11612.92
5.3.190.0070.10412.94
5.3.180.0060.09612.93
5.3.170.0030.10812.97
5.3.160.0060.10312.94
5.3.150.0040.09512.93
5.3.140.0090.11212.94
5.3.130.0060.11412.96
5.3.120.0100.10712.93
5.3.110.0080.11412.92
5.3.100.0080.10212.79
5.3.90.0040.10612.75
5.3.80.0020.11612.75
5.3.70.0030.11312.76
5.3.60.0030.12112.75
5.3.50.0100.12712.67
5.3.40.0040.11812.74
5.3.30.0010.11812.66
5.3.20.0040.10912.65
5.3.10.0040.09812.63
5.3.00.0040.11712.63
5.2.170.0100.11013.20
5.2.160.0110.08113.20
5.2.150.0050.10313.20
5.2.140.0020.12413.20
5.2.130.0070.08413.20
5.2.120.0050.12013.20
5.2.110.0050.10913.20
5.2.100.0030.09413.20
5.2.90.0020.08813.20
5.2.80.0030.10313.20
5.2.70.0060.10913.20
5.2.60.0060.10813.20
5.2.50.0050.09013.20
5.2.40.0070.11813.20
5.2.30.0070.11213.20
5.2.20.0050.10713.20
5.2.10.0050.10213.20
5.2.00.0060.10413.20
5.1.60.0070.11113.20
5.1.50.0030.09713.20
5.1.40.0060.12013.20
5.1.30.0050.11813.20
5.1.20.0030.10213.20
5.1.10.0050.09413.20
5.1.00.0060.11113.20
5.0.50.0020.09513.20
5.0.40.0080.09613.20
5.0.30.0020.13013.20
5.0.20.0080.11413.20
5.0.10.0030.12313.20
5.0.00.0020.12913.20
4.4.90.0050.11713.20
4.4.80.0020.11513.20
4.4.70.0000.10913.20
4.4.60.0000.10813.20
4.4.50.0000.08913.20
4.4.40.0000.13713.20
4.4.30.0050.09713.20
4.4.20.0030.08113.20
4.4.10.0020.10913.20
4.4.00.0020.11213.20
4.3.110.0020.09013.20
4.3.100.0020.08413.20
4.3.90.0020.08713.20
4.3.80.0050.11113.20
4.3.70.0070.10413.20
4.3.60.0020.08513.20
4.3.50.0030.09313.20
4.3.40.0000.12013.20
4.3.30.0020.09713.20
4.3.20.0000.10413.20
4.3.10.0020.08313.20
4.3.00.0030.11513.20

preferences:
50.74 ms | 401 KiB | 5 Q