3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class Module { private static $mask = '[[[%s]]]'; public static function work($it) { return preg_replace_callback('~\w+~', 'static::replace', $it); } private static function replace($matches) { return sprintf(static::$mask, $matches[0]); } } abstract class Module2 extends Module { protected static $mask = '{{{%s}}}'; } echo Module::work('hello world.'), "\n"; echo Module2::work('hello world.');

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)
8.3.40.0040.01118.95
8.3.30.0150.00618.79
8.3.20.0040.00420.36
8.3.10.0000.00723.55
8.3.00.0040.00420.52
8.2.170.0070.00722.96
8.2.160.0040.01122.21
8.2.150.0080.00024.18
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0100.00322.39
8.2.110.0070.00319.23
8.2.100.0060.00618.16
8.2.90.0080.00018.00
8.2.80.0040.00417.97
8.2.70.0000.00917.93
8.2.60.0030.00618.03
8.2.50.0080.00018.16
8.2.40.0000.00820.59
8.2.30.0050.00318.20
8.2.20.0030.00617.94
8.2.10.0040.00417.94
8.2.00.0000.00817.90
8.1.270.0040.00423.88
8.1.260.0040.00426.35
8.1.250.0000.00828.09
8.1.240.0040.00422.46
8.1.230.0040.00920.98
8.1.220.0030.00717.76
8.1.210.0030.00618.77
8.1.200.0030.00717.35
8.1.190.0080.00317.23
8.1.180.0050.00518.10
8.1.170.0050.00318.71
8.1.160.0040.00421.98
8.1.150.0000.00718.66
8.1.140.0040.00417.47
8.1.130.0000.00717.78
8.1.120.0070.00017.41
8.1.110.0040.00417.52
8.1.100.0070.00017.38
8.1.90.0040.00417.50
8.1.80.0030.00417.38
8.1.70.0000.00717.43
8.1.60.0000.00817.68
8.1.50.0040.00417.65
8.1.40.0000.00817.61
8.1.30.0040.00417.60
8.1.20.0030.00617.75
8.1.10.0030.00517.57
8.1.00.0050.00317.58
8.0.300.0000.00720.08
8.0.290.0040.00416.88
8.0.280.0030.00318.48
8.0.270.0030.00317.20
8.0.260.0070.00016.97
8.0.250.0070.00017.05
8.0.240.0040.00417.02
8.0.230.0000.00717.08
8.0.220.0040.00417.00
8.0.210.0070.00016.86
8.0.200.0030.00316.95
8.0.190.0000.00717.00
8.0.180.0040.00416.90
8.0.170.0000.00817.00
8.0.160.0040.00417.08
8.0.150.0000.00716.95
8.0.140.0000.00716.90
8.0.130.0030.00313.33
8.0.120.0030.00616.91
8.0.110.0050.00216.95
8.0.100.0000.00716.93
8.0.90.0070.00016.86
8.0.80.0130.00616.89
8.0.70.0020.00517.03
8.0.60.0040.00416.88
8.0.50.0040.00416.71
8.0.30.0140.00417.12
8.0.20.0120.00617.49
8.0.10.0050.00316.95
8.0.00.0110.00616.88
7.4.330.0020.00215.02
7.4.320.0030.00316.70
7.4.300.0060.00016.65
7.4.290.0030.00316.67
7.4.280.0030.00316.70
7.4.270.0000.00716.51
7.4.260.0070.00016.65
7.4.250.0040.00416.72
7.4.240.0000.00716.63
7.4.230.0030.00316.50
7.4.220.0100.01016.62
7.4.210.0090.00616.72
7.4.200.0050.00316.79
7.4.190.0070.00016.53
7.4.160.0070.01016.75
7.4.150.0070.01017.40
7.4.140.0110.00817.86
7.4.130.0130.00816.68
7.4.120.0050.01416.74
7.4.110.0070.01016.82
7.4.100.0150.00616.73
7.4.90.0100.00716.47
7.4.80.0140.00916.68
7.4.70.0100.01316.61
7.4.60.0160.00516.48
7.4.50.0040.00416.39
7.4.40.0000.01622.77
7.4.30.0090.01216.55
7.4.00.0000.01615.25
7.3.330.0000.00513.38
7.3.320.0050.00013.54
7.3.310.0030.00316.54
7.3.300.0030.00316.52
7.3.290.0030.01816.37
7.3.280.0090.01016.46
7.3.270.0140.00317.40
7.3.260.0060.01116.88
7.3.250.0080.01216.67
7.3.240.0100.00716.48
7.3.230.0090.01216.43
7.3.210.0160.00616.66
7.3.200.0060.01219.39
7.3.190.0100.00716.83
7.3.180.0060.01016.84
7.3.170.0090.00916.72
7.3.160.0110.00716.48
7.3.120.0030.01214.80
7.3.10.0060.00916.69
7.3.00.0120.00316.75
7.2.330.0140.00416.84
7.2.320.0050.01116.85
7.2.310.0130.00316.79
7.2.300.0090.00916.79
7.2.290.0110.00616.55
7.2.130.0100.00316.99
7.2.120.0060.00617.28
7.2.110.0060.00917.04
7.2.100.0040.00717.02
7.2.90.0050.00617.08
7.2.80.0070.00717.07
7.2.70.0070.00316.84
7.2.60.0090.00617.05
7.2.50.0060.01017.01
7.2.40.0040.00816.82
7.2.30.0000.01817.13
7.2.20.0070.00717.02
7.2.10.0000.01517.14
7.2.00.0040.01018.27
7.1.250.0140.00016.09
7.1.200.0030.01015.82
7.1.100.0030.00718.16
7.1.70.0000.00717.50
7.1.60.0100.01419.27
7.1.50.0040.01517.05
7.1.00.0070.07322.37
7.0.200.0030.00616.83
7.0.140.0000.07321.92
7.0.60.0030.06719.93
7.0.50.0030.04317.89
7.0.40.0070.04320.32
7.0.30.0230.04720.27
7.0.20.0230.08020.24
7.0.10.0100.08320.28
7.0.00.0070.05320.10
5.6.280.0030.07720.78
5.6.210.0130.04720.64
5.6.200.0030.05018.21
5.6.190.0130.07320.61
5.6.180.0100.07320.50
5.6.170.0270.08320.44
5.6.160.0030.05720.70
5.6.150.0100.08018.19
5.6.140.0070.08318.18
5.6.130.0030.06018.19
5.6.120.0100.07321.00
5.6.110.0030.08020.99
5.6.100.0030.08021.03
5.6.90.0070.06321.08
5.6.80.0070.08720.49
5.5.350.0030.08720.33
5.5.340.0030.06718.07
5.5.330.0130.07720.57
5.5.320.0130.04720.32
5.5.310.0230.06020.35
5.5.300.0100.06317.99
5.5.290.0070.08018.00
5.5.280.0130.05720.81
5.5.270.0070.09320.90
5.5.260.0100.08020.77
5.5.250.0100.06320.59
5.5.240.0000.03720.17
5.4.450.2300.05019.55
5.4.440.1930.04019.20
5.4.430.1830.03719.30
5.4.420.1900.04019.20
5.4.410.1830.03319.34
5.4.400.2000.03019.32
5.4.390.1870.04019.14
5.4.380.2030.04018.88
5.4.370.1770.03719.06
5.4.360.2030.04719.00
5.4.350.1800.03319.09
5.4.340.1600.04319.18
5.4.320.0070.08019.32
5.4.310.0100.03019.14
5.4.300.0170.03319.13
5.4.290.1300.04719.09
5.4.280.1770.04019.24
5.4.270.1770.03719.19
5.4.260.1500.04019.09
5.4.250.2030.04319.11
5.4.240.2070.04318.97
5.4.230.1770.04019.08
5.4.220.1830.03318.86
5.4.210.2000.04719.30
5.4.200.1670.03719.07
5.4.190.1900.04318.97
5.4.180.1970.03719.18
5.4.170.1870.04019.12
5.4.160.1830.03318.98
5.4.150.1870.03718.95
5.4.140.2070.04016.55
5.4.130.2070.03716.44
5.4.120.1830.03316.38
5.4.110.2130.04016.59
5.4.100.2070.04016.64
5.4.90.1930.03716.52
5.4.80.2200.04016.55
5.4.70.2230.05016.39
5.4.60.2300.04316.43
5.4.50.2170.04016.48
5.4.40.2170.03716.53
5.4.30.2330.03316.19
5.4.20.2100.03716.51
5.4.10.1900.03316.27
5.4.00.2270.04015.77
5.3.290.2000.03714.57
5.3.280.2100.03014.60
5.3.270.2230.04014.60
5.3.260.2200.04014.52
5.3.250.2100.04014.52
5.3.240.0670.03714.72
5.3.230.0100.03014.59
5.3.220.0070.04714.65
5.3.210.0200.03714.62
5.3.200.2030.03314.80
5.3.190.2000.03714.49
5.3.180.2000.03314.64
5.3.170.2130.03014.64
5.3.160.2030.03714.54
5.3.150.2070.03014.46
5.3.140.2030.04014.68
5.3.130.1970.04314.46
5.3.120.2300.03714.52
5.3.110.2130.02714.70
5.3.100.2170.04713.96
5.3.90.2170.04014.25
5.3.80.2370.04314.07
5.3.70.2070.04014.10
5.3.60.2270.03314.15
5.3.50.2400.03013.97
5.3.40.2170.04313.86
5.3.30.2230.03713.84
5.3.20.2200.04013.84
5.3.10.2170.04013.59
5.3.00.1900.03713.55
5.2.170.1830.02311.23
5.2.160.1630.03011.07
5.2.150.1900.04011.23
5.2.140.1630.02711.05
5.2.130.1930.03711.16
5.2.120.1700.02311.02
5.2.110.1870.03711.08
5.2.100.1600.02711.33
5.2.90.1770.03011.16
5.2.80.1800.03711.24
5.2.70.1800.03711.00
5.2.60.1900.03311.16
5.2.50.1830.03011.00
5.2.40.1570.03011.01
5.2.30.1530.03310.95
5.2.20.1430.03011.18
5.2.10.1570.02710.88
5.2.00.1400.03010.62
5.1.60.1470.0279.92
5.1.50.1330.0209.95
5.1.40.1330.0209.96
5.1.30.1530.02310.27
5.1.20.1330.02310.47
5.1.10.1300.0279.96
5.1.00.1330.02310.23
5.0.50.0730.0208.70
5.0.40.0670.0208.31
5.0.30.0630.0308.16
5.0.20.0630.0208.21
5.0.10.0770.0238.15
5.0.00.0730.0408.17
4.4.90.0670.0137.93
4.4.80.0600.0177.93
4.4.70.0700.0107.93
4.4.60.0800.0137.93
4.4.50.0670.0137.93
4.4.40.0730.0307.93
4.4.30.0800.0137.93
4.4.20.0800.0177.93
4.4.10.0870.0177.93
4.4.00.0770.0277.93
4.3.110.0800.0237.93
4.3.100.0630.0137.93
4.3.90.0700.0207.93
4.3.80.0830.0337.93
4.3.70.0630.0177.93
4.3.60.0630.0137.93
4.3.50.0630.0177.93
4.3.40.0630.0237.93
4.3.30.0370.0237.93
4.3.20.0470.0237.93
4.3.10.0400.0177.93
4.3.00.0400.0137.93

preferences:
50.43 ms | 400 KiB | 5 Q