3v4l.org

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

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.60.0040.01118.55
8.3.50.0100.01222.03
8.3.40.0100.01019.05
8.3.30.0070.00719.19
8.3.20.0070.00720.34
8.3.10.0080.00023.65
8.3.00.0040.00420.54
8.2.180.0090.00616.50
8.2.170.0170.00322.96
8.2.160.0130.00319.04
8.2.150.0000.00824.18
8.2.140.0090.00024.66
8.2.130.0040.00426.16
8.2.120.0080.00022.28
8.2.110.0040.00422.16
8.2.100.0040.00717.97
8.2.90.0000.00819.35
8.2.80.0000.00817.97
8.2.70.0060.00317.88
8.2.60.0100.00017.78
8.2.50.0030.00518.07
8.2.40.0030.00518.34
8.2.30.0060.00318.21
8.2.20.0040.00417.95
8.2.10.0040.00417.97
8.2.00.0090.00017.93
8.1.280.0140.00425.92
8.1.270.0130.00623.96
8.1.260.0040.00426.35
8.1.250.0030.00628.09
8.1.240.0060.00323.91
8.1.230.0040.00719.06
8.1.220.0080.00017.74
8.1.210.0060.00318.77
8.1.200.0040.00417.23
8.1.190.0080.00017.16
8.1.180.0000.00818.10
8.1.170.0050.00318.84
8.1.160.0090.00021.99
8.1.150.0050.00318.67
8.1.140.0060.00317.48
8.1.130.0030.00317.77
8.1.120.0030.00517.37
8.1.110.0070.00017.40
8.1.100.0090.00017.40
8.1.90.0040.00417.46
8.1.80.0100.00017.43
8.1.70.0000.00717.35
8.1.60.0040.00417.68
8.1.50.0000.00917.52
8.1.40.0030.00617.65
8.1.30.0000.00817.66
8.1.20.0040.00417.67
8.1.10.0000.00717.64
8.1.00.0040.00417.50
8.0.300.0070.00018.77
8.0.290.0040.00417.16
8.0.280.0050.00318.48
8.0.270.0050.00217.25
8.0.260.0060.00317.05
8.0.250.0000.00717.11
8.0.240.0070.00017.17
8.0.230.0000.00817.13
8.0.220.0000.00717.02
8.0.210.0020.00516.95
8.0.200.0000.00717.13
8.0.190.0030.00517.13
8.0.180.0000.00717.11
8.0.170.0040.00417.09
8.0.160.0040.00416.92
8.0.150.0000.00816.88
8.0.140.0000.00717.04
8.0.130.0000.00613.57
8.0.120.0040.00416.92
8.0.110.0040.00417.00
8.0.100.0040.00417.00
8.0.90.0040.00416.91
8.0.80.0080.00817.09
8.0.70.0070.00016.89
8.0.60.0040.00416.95
8.0.50.0050.00217.00
8.0.30.0090.01017.10
8.0.20.0140.00517.40
8.0.10.0000.00717.02
8.0.00.0120.00917.04
7.4.330.0000.00515.00
7.4.320.0060.00016.52
7.4.300.0030.00316.56
7.4.290.0030.00316.69
7.4.280.0040.00416.75
7.4.270.0000.00816.71
7.4.260.0070.00016.79
7.4.250.0040.00416.73
7.4.240.0040.00416.69
7.4.230.0000.00716.56
7.4.220.0070.01016.79
7.4.210.0110.00516.82
7.4.200.0030.00316.86
7.4.190.0000.00716.92
7.4.160.0030.01316.70
7.4.150.0130.00617.40
7.4.140.0110.01017.86
7.4.130.0070.01016.65
7.4.120.0110.00616.70
7.4.110.0070.01016.75
7.4.100.0130.00316.69
7.4.90.0060.01216.71
7.4.80.0100.00616.63
7.4.70.0070.01016.75
7.4.60.0120.00616.71
7.4.50.0070.00016.78
7.4.40.0060.00922.77
7.4.30.0070.01116.43
7.4.00.0030.01015.08
7.3.330.0000.00513.56
7.3.320.0050.00013.59
7.3.310.0000.00716.56
7.3.300.0000.00716.59
7.3.290.0140.00016.53
7.3.280.0120.00516.53
7.3.270.0100.00617.40
7.3.260.0150.00616.58
7.3.250.0050.01316.67
7.3.240.0140.00316.54
7.3.230.0060.01216.66
7.3.210.0100.01016.75
7.3.200.0120.00619.39
7.3.190.0130.00916.51
7.3.180.0070.01016.69
7.3.170.0110.01216.63
7.3.160.0000.01516.63
7.3.120.0000.01014.99
7.3.10.0070.00716.79
7.3.00.0070.00316.75
7.2.330.0060.01316.64
7.2.320.0080.00816.88
7.2.310.0060.01516.60
7.2.300.0070.01016.87
7.2.290.0060.01016.88
7.2.130.0120.00317.20
7.2.120.0070.00716.89
7.2.110.0000.01617.04
7.2.100.0060.00917.03
7.2.90.0070.00417.16
7.2.80.0070.01116.87
7.2.70.0060.00617.25
7.2.60.0180.00916.96
7.2.50.0060.00917.05
7.2.40.0060.00617.06
7.2.30.0090.00617.02
7.2.20.0030.01316.84
7.2.10.0030.01017.21
7.2.00.0020.01518.37
7.1.250.0040.00715.68
7.1.200.0090.00316.13
7.1.100.0030.01018.34
7.1.70.0050.00517.28
7.1.60.0140.00319.32
7.1.50.0130.00017.15
7.1.00.0030.07722.41
7.0.200.0060.00316.98
7.0.140.0070.07022.04
7.0.60.0100.03320.03
7.0.50.0100.08317.99
7.0.40.0030.04720.15
7.0.30.0130.04320.35
7.0.20.0300.05320.21
7.0.10.0030.08320.25
7.0.00.0030.04720.07
5.6.280.0030.07021.11
5.6.210.0130.05020.75
5.6.200.0070.05318.22
5.6.190.0070.07020.34
5.6.180.0330.07320.52
5.6.170.0200.04720.62
5.6.160.0100.08320.75
5.6.150.0000.04318.17
5.6.140.0070.04018.29
5.6.130.0100.07718.12
5.6.120.0170.07720.99
5.6.110.0100.06721.02
5.6.100.0030.08320.89
5.6.90.0130.05721.11
5.6.80.0130.07720.45
5.5.350.0130.08720.38
5.5.340.0070.08317.98
5.5.330.0170.08020.18
5.5.320.0400.05320.25
5.5.310.0170.04320.30
5.5.300.0200.06317.92
5.5.290.0070.08718.08
5.5.280.0100.05020.89
5.5.270.0070.08320.88
5.5.260.0030.04020.65
5.5.250.0070.04020.55
5.5.240.0030.08320.37
5.4.450.4670.03719.57
5.4.440.0030.04019.39
5.4.430.3800.03719.47
5.4.420.3870.03719.39
5.4.410.2830.03019.18
5.4.400.4030.04018.96
5.4.390.1370.03719.16
5.4.380.2930.03718.82
5.4.370.3430.03319.09
5.4.360.4000.04719.18
5.4.350.3600.04018.94
5.4.340.3530.04019.08
5.4.320.3470.04319.09
5.4.310.3530.03319.00
5.4.300.3100.04019.22
5.4.290.3570.03318.98
5.4.280.3630.04019.33
5.4.270.3800.03719.24
5.4.260.3570.03719.14
5.4.250.3730.04019.00
5.4.240.3570.03018.98
5.4.230.3670.03718.86
5.4.220.3530.03718.99
5.4.210.3600.03719.21
5.4.200.3700.03719.08
5.4.190.3770.04319.05
5.4.180.3500.03718.86
5.4.170.4230.03719.26
5.4.160.3700.04019.17
5.4.150.3430.04018.83
5.4.140.3470.03716.43
5.4.130.3530.03016.39
5.4.120.3530.04016.40
5.4.110.3430.03716.41
5.4.100.3970.03316.61
5.4.90.3730.02716.32
5.4.80.3600.04016.24
5.4.70.3770.03316.34
5.4.60.2630.04316.49
5.4.50.3500.03716.55
5.4.40.3700.04016.57
5.4.30.3500.03316.56
5.4.20.3500.02716.23
5.4.10.3500.03716.18
5.4.00.3770.04015.82
5.3.290.3670.04014.84
5.3.280.3870.03314.50
5.3.270.3170.03714.60
5.3.260.3530.03314.52
5.3.250.3600.04014.79
5.3.240.3500.03014.61
5.3.230.3570.03714.76
5.3.220.3700.03714.65
5.3.210.3830.04014.69
5.3.200.3470.03314.47
5.3.190.3630.03714.56
5.3.180.3500.03714.68
5.3.170.3800.03314.46
5.3.160.3430.03714.79
5.3.150.3770.03314.47
5.3.140.3670.03714.61
5.3.130.3570.03014.56
5.3.120.3830.04014.71
5.3.110.3570.03314.52
5.3.100.3670.03313.97
5.3.90.3470.04014.14
5.3.80.3600.03713.93
5.3.70.3770.03013.95
5.3.60.3300.03013.91
5.3.50.3970.03714.00
5.3.40.3270.03714.04
5.3.30.3830.03313.92
5.3.20.3600.02713.78
5.3.10.3470.03313.64
5.3.00.3830.03013.57
5.2.170.3870.03711.26
5.2.160.3370.03311.27
5.2.150.3170.02711.31
5.2.140.2570.03311.05
5.2.130.3070.03311.23
5.2.120.3030.03311.01
5.2.110.3130.03011.08
5.2.100.3130.03011.02
5.2.90.3170.02711.18
5.2.80.2730.03011.18
5.2.70.3030.02711.12
5.2.60.3030.02311.14
5.2.50.3200.02711.02
5.2.40.2570.03010.92
5.2.30.2300.03011.05
5.2.20.2470.02710.86
5.2.10.2500.03310.87
5.2.00.2170.02710.77
5.1.60.3030.0239.93
5.1.50.2470.02310.09
5.1.40.2430.0279.97
5.1.30.2600.01710.39
5.1.20.2500.03010.41
5.1.10.2530.03010.16
5.1.00.2270.03010.01
5.0.50.1470.0208.47
5.0.40.1330.0178.30
5.0.30.1370.0278.16
5.0.20.1700.0208.18
5.0.10.1230.0178.07
5.0.00.1200.0308.17
4.4.90.1230.0176.07
4.4.80.1200.0176.07
4.4.70.1200.0176.07
4.4.60.1230.0136.07
4.4.50.1200.0136.07
4.4.40.1270.0236.07
4.4.30.1400.0176.07
4.4.20.1230.0176.07
4.4.10.1230.0136.07
4.4.00.1230.0236.07
4.3.110.1230.0136.07
4.3.100.1230.0136.07
4.3.90.1400.0176.07
4.3.80.1330.0276.07
4.3.70.1230.0136.07
4.3.60.1200.0136.07
4.3.50.1200.0176.07
4.3.40.1200.0236.07
4.3.30.0600.0136.07
4.3.20.0570.0136.07
4.3.10.0530.0176.07
4.3.00.0530.0176.07

preferences:
36.11 ms | 401 KiB | 5 Q