3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo Module::work('hello world.'), "\n"; echo MyModule::work('hello world.'); abstract class Module { protected static $mask = '[[[%s]]]'; public static function work($it) { return preg_replace_callback('~\w+~', 'self::replace' /* array('self', 'self::replace') */, $it); } protected static function replace($matches) { return sprintf(static::$mask, $matches[0]); } } abstract class MyModule extends Module { protected 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.70.0180.00418.55
8.3.60.0140.00716.75
8.3.50.0030.01417.53
8.3.40.0040.01118.88
8.3.30.0140.00019.10
8.3.20.0080.00019.03
8.3.10.0050.00320.61
8.3.00.0040.00419.51
8.2.180.0150.00316.88
8.2.170.0100.01022.96
8.2.160.0150.00622.18
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0050.00326.16
8.2.120.0000.00719.77
8.2.110.0060.00320.47
8.2.100.0000.01118.16
8.2.90.0090.00019.20
8.2.80.0000.00817.97
8.2.70.0050.00317.88
8.2.60.0050.00318.04
8.2.50.0040.00418.07
8.2.40.0050.00218.24
8.2.30.0000.00818.03
8.2.20.0050.00217.81
8.2.10.0030.00517.85
8.2.00.0070.00017.65
8.1.280.0070.01125.92
8.1.270.0040.00424.66
8.1.260.0070.00026.35
8.1.250.0060.00328.09
8.1.240.0090.00022.12
8.1.230.0000.01121.04
8.1.220.0080.00017.79
8.1.210.0060.00318.77
8.1.200.0060.00317.25
8.1.190.0060.00317.40
8.1.180.0040.00418.10
8.1.170.0040.00418.77
8.1.160.0000.00718.89
8.1.150.0040.00418.54
8.1.140.0070.00017.39
8.1.130.0030.00317.73
8.1.120.0000.00717.38
8.1.110.0040.00417.37
8.1.100.0080.00017.50
8.1.90.0050.00317.51
8.1.80.0070.00017.50
8.1.70.0000.00817.46
8.1.60.0060.00317.69
8.1.50.0040.00417.56
8.1.40.0040.00417.64
8.1.30.0000.00717.75
8.1.20.0040.00417.64
8.1.10.0050.00317.70
8.1.00.0000.00717.48
8.0.300.0050.00218.77
8.0.290.0030.00616.75
8.0.280.0000.00818.54
8.0.270.0040.00417.34
8.0.260.0030.00316.88
8.0.250.0050.00317.07
8.0.240.0040.00417.14
8.0.230.0030.00316.92
8.0.220.0000.00716.96
8.0.210.0040.00316.97
8.0.200.0000.00717.02
8.0.190.0000.00717.01
8.0.180.0000.00716.99
8.0.170.0000.01017.01
8.0.160.0000.00716.82
8.0.150.0000.00816.82
8.0.140.0040.00616.77
8.0.130.0050.00013.33
8.0.120.0000.00716.90
8.0.110.0050.00216.80
8.0.100.0040.00416.95
8.0.90.0040.00416.86
8.0.80.0060.01216.88
8.0.70.0080.00016.79
8.0.60.0040.00416.92
8.0.50.0000.00816.96
8.0.30.0090.00917.35
8.0.20.0090.01017.20
8.0.10.0040.00417.08
8.0.00.0110.00817.09
7.4.330.0050.00013.05
7.4.320.0060.00016.64
7.4.300.0000.00716.73
7.4.290.0000.00716.74
7.4.280.0060.00316.62
7.4.270.0070.00016.63
7.4.260.0030.00313.32
7.4.250.0050.00316.68
7.4.240.0070.00016.61
7.4.230.0070.00016.64
7.4.220.0090.00916.66
7.4.210.0090.00816.73
7.4.200.0000.00716.55
7.4.190.0070.00016.71
7.4.160.0080.00816.66
7.4.150.0120.00616.75
7.4.140.0100.01016.59
7.4.130.0140.00716.60
7.4.120.0120.00516.56
7.4.110.0060.01216.63
7.4.100.0070.01016.55
7.4.90.0170.00716.62
7.4.80.0140.00316.78
7.4.70.0090.00916.65
7.4.60.0080.00816.79
7.4.50.0060.00316.74
7.4.40.0060.00616.73
7.4.30.0140.00316.84
7.4.00.0060.00815.00
7.3.330.0000.00613.47
7.3.320.0030.00313.58
7.3.310.0040.00416.30
7.3.300.0040.00416.39
7.3.290.0070.00716.35
7.3.280.0070.00716.48
7.3.270.0030.01316.75
7.3.260.0110.00516.66
7.3.250.0160.00516.61
7.3.240.0040.01616.55
7.3.230.0080.00816.59
7.3.210.0110.01216.63
7.3.200.0070.01119.39
7.3.190.0170.00616.77
7.3.180.0030.01416.68
7.3.170.0100.00716.46
7.3.160.0120.00616.47
7.3.120.0070.01115.18
7.3.110.0120.00615.02
7.3.100.0110.00015.03
7.3.90.0030.01015.21
7.3.80.0060.00914.92
7.3.70.0060.00314.83
7.3.60.0080.00015.08
7.3.50.0080.00014.82
7.3.40.0070.01014.96
7.3.30.0120.00315.01
7.3.20.0040.00716.80
7.3.10.0030.00916.86
7.3.00.0040.01216.45
7.2.330.0040.01316.89
7.2.320.0110.00616.81
7.2.310.0120.01216.71
7.2.300.0070.01016.69
7.2.290.0100.01316.90
7.2.250.0070.01315.41
7.2.240.0070.01015.03
7.2.230.0070.01015.25
7.2.220.0090.00315.12
7.2.210.0040.00814.96
7.2.200.0090.00614.83
7.2.190.0070.00715.25
7.2.180.0080.00815.14
7.2.170.0060.01215.11
7.2.130.0100.00717.14
7.2.120.0040.01116.85
7.2.110.0070.00717.00
7.2.100.0030.01016.78
7.2.90.0090.00617.06
7.2.80.0100.00017.00
7.2.70.0070.00416.81
7.2.60.0130.00716.88
7.2.50.0130.00617.03
7.2.40.0140.00717.18
7.2.30.0050.00516.94
7.2.20.0090.00316.62
7.2.10.0120.00316.93
7.2.00.0020.01218.48
7.1.330.0030.01116.01
7.1.320.0070.00716.09
7.1.310.0000.01516.07
7.1.300.0000.00915.89
7.1.290.0000.01115.98
7.1.280.0110.00315.85
7.1.270.0060.01215.81
7.1.260.0040.00716.07
7.1.250.0000.00915.85
7.1.200.0080.00315.66
7.1.100.0070.01018.00
7.1.70.0060.00917.20
7.1.60.0140.01119.40
7.1.50.0100.01017.04
7.1.00.0100.02722.28
7.0.200.0070.00316.88
7.0.140.0030.07722.07
7.0.120.0070.06322.02
7.0.60.0030.09019.79
7.0.50.0070.03717.82
7.0.40.0070.07720.31
7.0.30.0270.07020.17
7.0.20.0230.06020.12
7.0.10.0430.06320.26
7.0.00.0170.06020.17
5.6.280.0030.07321.07
5.6.210.0070.08320.77
5.6.200.0070.04718.20
5.6.190.0000.08720.51
5.6.180.0300.04020.61
5.6.170.0300.03320.57
5.6.160.0070.08320.57
5.6.150.0070.06018.18
5.6.140.0070.04018.23
5.6.130.0030.04018.28
5.6.120.0070.05721.13
5.6.110.0070.07021.12
5.6.100.0070.07721.01
5.6.90.0070.04020.95
5.6.80.0170.07020.53
5.6.70.3730.04020.38
5.5.350.0300.06320.38
5.5.340.0070.05318.08
5.5.330.0100.08320.27
5.5.320.0030.08720.43
5.5.310.0270.05020.41
5.5.300.0100.03717.95
5.5.290.0130.03017.95
5.5.280.0130.07320.91
5.5.270.0100.07320.73
5.5.260.0130.05320.77
5.5.250.0100.08320.65
5.5.240.0070.07720.29
5.4.450.0030.08019.53
5.4.440.0130.07319.30
5.4.430.0000.06319.46
5.4.420.0030.08319.40
5.4.410.0100.05719.31
5.4.400.0030.07719.21
5.4.390.0070.03719.21
5.4.380.0070.07719.24
5.4.370.0000.05718.87
5.4.360.0070.07719.16
5.4.350.0030.04019.14
5.4.340.0030.05718.88
5.4.320.0100.07319.24
5.4.310.0100.04719.01
5.4.300.0230.03018.97
5.4.290.0030.04019.24
5.4.280.0070.05319.08
5.4.270.0030.04719.00
5.4.260.0070.07019.25
5.4.250.0070.06018.85
5.4.240.0030.04019.24
5.4.230.0070.04318.97
5.4.220.0130.06718.88
5.4.210.0070.04319.07
5.4.200.0070.03719.13
5.4.190.0070.04318.86
5.4.180.0030.04719.23
5.4.170.0000.05019.23
5.4.160.0100.06319.09
5.4.150.0070.03719.13
5.4.140.0070.03716.39
5.4.130.0000.05016.38
5.4.120.0170.05716.36
5.4.110.0070.04316.74
5.4.100.0130.06716.36
5.4.90.0100.06716.72
5.4.80.0030.03716.50
5.4.70.0030.04316.42
5.4.60.0000.06016.27
5.4.50.0000.05316.38
5.4.40.0030.07716.29
5.4.30.0070.04316.49
5.4.20.0100.07316.25
5.4.10.0030.05016.43
5.4.00.0030.05015.91
5.3.290.0000.04314.69
5.3.280.0030.04714.61
5.3.270.0030.05714.50
5.3.260.0130.07014.76
5.3.250.0130.05714.60
5.3.240.0000.06314.67
5.3.230.0200.03314.52
5.3.220.0000.05314.61
5.3.210.0100.06014.59
5.3.200.0030.06714.64
5.3.190.0100.07314.62
5.3.180.0000.05014.59
5.3.170.0070.08014.56
5.3.160.0100.04714.62
5.3.150.0070.04314.73
5.3.140.0100.03014.58
5.3.130.0100.07014.59
5.3.120.0130.07314.61
5.3.110.0070.07314.62
5.3.100.0100.07014.09
5.3.90.0100.05013.95
5.3.80.0030.04714.02
5.3.70.0070.07014.07
5.3.60.0030.04314.07
5.3.50.0030.04313.95
5.3.40.0070.07713.99
5.3.30.0070.07713.80
5.3.20.0070.04013.72
5.3.10.0130.04013.73
5.3.00.0030.04313.61
5.2.170.0030.03011.12
5.2.160.0070.05011.18
5.2.150.0000.04011.21
5.2.140.0030.03011.14
5.2.130.0070.06011.18
5.2.120.0070.06311.14
5.2.110.0030.04711.15
5.2.100.0070.04311.15
5.2.90.0030.04311.10
5.2.80.0030.03711.10
5.2.70.0070.03711.17
5.2.60.0100.06011.05
5.2.50.0000.06011.07
5.2.40.0100.04011.16
5.2.30.0030.07311.13
5.2.20.0100.05011.02
5.2.10.0070.02710.75
5.2.00.0030.04010.68
5.1.60.0000.0309.98
5.1.50.0030.02310.00
5.1.40.0000.0479.95
5.1.30.0030.03310.30
5.1.20.0100.04710.52
5.1.10.0070.04310.14
5.1.00.0030.03010.02
5.0.50.0100.0338.62
5.0.40.0000.0508.62
5.0.30.0000.0338.62
5.0.20.0030.0308.62
5.0.10.0000.0478.62
5.0.00.0000.0708.62
4.4.90.0000.0378.62
4.4.80.0030.0208.62
4.4.70.0030.0278.62
4.4.60.0000.0338.62
4.4.50.0030.0138.62
4.4.40.0030.0278.62
4.4.30.0070.0308.62
4.4.20.0030.0238.62
4.4.10.0000.0208.62
4.4.00.0030.0308.62
4.3.110.0000.0208.62
4.3.100.0000.0178.62
4.3.90.0000.0208.62
4.3.80.0000.0478.62
4.3.70.0000.0238.62
4.3.60.0030.0308.62
4.3.50.0030.0378.62
4.3.40.0030.0378.62
4.3.30.0030.0338.62
4.3.20.0000.0308.62
4.3.10.0030.0278.62
4.3.00.0030.0238.62

preferences:
52 ms | 401 KiB | 5 Q