3v4l.org

run code in 300+ PHP versions simultaneously
<?php function replace($string) { return preg_replace_callback('/(?<tag>(?<enter><)?!(?<level>\d+)!(?<leave>>)?)/', function ($match) { $level = (int) $match['level']; $enter = !empty($match['enter']); $leave = !empty($match['leave']); if ($enter === $leave) { var_dump($match); return $match['tag']; } if ($level > 0) { return vsprintf('%s!%d!%s', [ $enter ? '<' : null, $level - 1, $leave ? '>' : null, ]); } return vsprintf('%s?%s', [ $enter ? '<' : null, $leave ? '>' : null, ]); }, $string); } $string = '<!3!= "<!2!= "<!1!= "<!0!= "noodles" !0!>" !1!>" !2!>" !3!>'; ob_start(); eval(sprintf('; ?>%s<?php ', replace($string))); $string = ob_get_clean(); echo $string . PHP_EOL; ob_start(); eval(sprintf('; ?>%s<?php ', replace($string))); $string = ob_get_clean(); echo $string . PHP_EOL; ob_start(); eval(sprintf('; ?>%s<?php ', replace($string))); $string = ob_get_clean(); echo $string . PHP_EOL; ob_start(); eval(sprintf('; ?>%s<?php ', replace($string))); $string = ob_get_clean(); echo $string . PHP_EOL;

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.0180.00418.96
8.3.30.0070.00720.37
8.3.20.0090.00020.63
8.3.10.0040.00421.16
8.3.00.0080.00023.65
8.2.170.0120.00819.24
8.2.160.0060.00922.96
8.2.150.0120.00325.66
8.2.140.0040.00424.66
8.2.130.0000.00726.16
8.2.120.0080.00021.25
8.2.110.0060.00320.34
8.2.100.0100.00317.84
8.2.90.0000.00819.25
8.2.80.0060.00319.47
8.2.70.0030.00718.00
8.2.60.0000.00817.93
8.2.50.0090.00018.07
8.2.40.0030.00518.28
8.2.30.0000.00819.41
8.2.20.0040.00417.86
8.2.10.0060.00318.00
8.2.00.0030.00617.84
8.1.270.0000.00823.99
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0060.00323.98
8.1.230.0040.00820.96
8.1.220.0060.00318.77
8.1.210.0030.00618.89
8.1.200.0090.00017.60
8.1.190.0080.00017.53
8.1.180.0030.00618.10
8.1.170.0040.00418.77
8.1.160.0040.00418.98
8.1.150.0000.00818.73
8.1.140.0000.00717.56
8.1.130.0000.00717.75
8.1.120.0000.00717.63
8.1.110.0050.00317.68
8.1.100.0000.00717.63
8.1.90.0050.00217.59
8.1.80.0000.00717.58
8.1.70.0030.00517.58
8.1.60.0040.00417.63
8.1.50.0000.00817.68
8.1.40.0080.00017.65
8.1.30.0040.00417.70
8.1.20.0000.00817.83
8.1.10.0000.00817.72
8.1.00.0060.00317.70
8.0.300.0070.00020.07
8.0.290.0060.00317.30
8.0.280.0000.00718.41
8.0.270.0000.00717.35
8.0.260.0070.00016.98
8.0.250.0000.00717.00
8.0.240.0100.00017.10
8.0.230.0030.00317.13
8.0.220.0000.00716.95
8.0.210.0060.00316.95
8.0.200.0000.00617.11
8.0.190.0040.00417.15
8.0.180.0030.00517.05
8.0.170.0050.00217.05
8.0.160.0050.00317.00
8.0.150.0000.00716.97
8.0.140.0070.00317.00
8.0.130.0060.00013.53
8.0.120.0000.00817.03
8.0.110.0080.00017.10
8.0.100.0000.00716.93
8.0.90.0080.00016.93
8.0.80.0070.00716.98
8.0.70.0000.00816.90
8.0.60.0000.00816.98
8.0.50.0050.00217.01
8.0.30.0110.00917.13
8.0.20.0140.00717.40
8.0.10.0040.00417.18
8.0.00.0120.00517.02
7.4.330.0020.00216.81
7.4.320.0030.00316.88
7.4.300.0030.00316.73
7.4.290.0000.00716.66
7.4.280.0000.00716.64
7.4.270.0030.00316.89
7.4.260.0000.00913.46
7.4.250.0000.00816.63
7.4.240.0000.00716.88
7.4.230.0030.00316.55
7.4.220.0090.01516.68
7.4.210.0110.00516.72
7.4.200.0050.00316.65
7.4.190.0000.00716.70
7.4.160.0120.00616.85
7.4.150.0040.01417.40
7.4.140.0140.00817.86
7.4.130.0130.00516.78
7.4.120.0080.00916.90
7.4.110.0140.01016.68
7.4.100.0000.01816.55
7.4.90.0070.01116.62
7.4.80.0070.01019.39
7.4.70.0120.00916.99
7.4.60.0130.00916.92
7.4.50.0000.00816.60
7.4.40.0120.00222.77
7.4.30.0090.00916.71
7.4.00.0080.00814.95
7.3.330.0050.00013.48
7.3.320.0000.00513.39
7.3.310.0000.00716.53
7.3.300.0030.00316.55
7.3.290.0130.00716.56
7.3.280.0090.00816.56
7.3.270.0130.00317.40
7.3.260.0120.01118.24
7.3.250.0130.00316.70
7.3.240.0030.01416.52
7.3.230.0150.00516.56
7.3.210.0120.00616.70
7.3.200.0160.00319.39
7.3.190.0000.01816.55
7.3.180.0160.00616.38
7.3.170.0120.00316.61
7.3.160.0120.01116.78
7.3.120.0100.00715.10
7.3.110.0090.00915.13
7.3.100.0070.00715.22
7.3.90.0040.01115.02
7.3.80.0060.00915.17
7.3.70.0090.00915.01
7.3.60.0090.00315.07
7.3.50.0070.00715.18
7.3.40.0030.01015.18
7.3.30.0120.00314.85
7.3.20.0040.01116.55
7.3.10.0000.01416.82
7.3.00.0060.00916.94
7.2.330.0100.01416.79
7.2.320.0180.00616.93
7.2.310.0090.01517.03
7.2.300.0090.01416.87
7.2.290.0070.01016.80
7.2.250.0060.01215.05
7.2.240.0120.00915.19
7.2.230.0120.00315.27
7.2.220.0100.01015.23
7.2.210.0000.01415.44
7.2.200.0070.01115.22
7.2.190.0060.00615.42
7.2.180.0030.01015.48
7.2.170.0030.01015.22
7.2.00.0070.00719.80
7.1.330.0070.00715.96
7.1.320.0060.00615.63
7.1.310.0070.00715.90
7.1.300.0000.01416.14
7.1.290.0000.01215.95
7.1.280.0030.00715.98
7.1.270.0040.00816.13
7.1.260.0030.00916.07
7.1.200.0040.00716.06
7.1.100.0000.01318.00
7.1.70.0000.01117.49
7.1.60.0130.01319.17
7.1.50.0110.01516.89
7.1.00.0100.06722.43
7.0.200.0030.00516.93
7.0.140.0030.07721.95
7.0.80.0370.08719.99
7.0.70.0500.03720.06
7.0.60.0600.08319.96
7.0.50.0300.07320.38
7.0.40.0100.07320.08
7.0.30.0170.08020.14
7.0.20.0130.08020.13
7.0.10.0100.04020.18
7.0.00.0070.05320.12
5.6.280.0070.06720.82
5.6.230.0130.05320.65
5.6.220.0070.08720.56
5.6.210.0070.06020.63
5.6.200.0100.05021.04
5.6.190.0170.07721.07
5.6.180.0100.08320.93
5.6.170.0030.05321.12
5.6.160.0130.04321.09
5.6.150.0070.07721.02
5.6.140.0000.04721.08
5.6.130.0070.05721.18
5.6.120.0100.08021.02
5.6.110.0030.07021.04
5.6.100.0070.05721.10
5.6.90.0030.08021.01
5.6.80.0070.04320.50
5.6.70.0070.06320.50
5.6.60.0070.08320.48
5.6.50.0100.07020.41
5.6.40.0100.07720.42
5.6.30.0130.04020.44
5.6.20.0070.07320.47
5.6.10.0100.08320.32
5.6.00.0100.07320.37
5.5.370.0070.07720.45
5.5.360.0170.07020.39
5.5.350.0130.07320.38
5.5.340.0000.08720.91
5.5.330.0100.06020.81
5.5.320.0100.04720.81
5.5.310.0030.07720.91
5.5.300.0070.04020.84
5.5.290.0130.04320.80
5.5.280.0000.05320.92
5.5.270.0100.08320.92
5.5.260.0100.07320.92
5.5.250.0200.07320.68
5.5.240.0030.08320.28
5.5.230.0130.08020.28
5.5.220.0070.04020.23
5.5.210.0130.03720.29
5.5.200.0100.07320.12
5.5.190.0030.05720.13
5.5.180.0070.07720.25
5.5.160.0000.06020.19
5.5.150.0070.07020.27
5.5.140.0000.09320.13
5.5.130.0100.07720.15
5.5.120.0100.07720.22
5.5.110.0100.07720.15
5.5.100.0030.08020.09
5.5.90.0100.07719.95
5.5.80.0030.07720.13
5.5.70.0100.07720.07
5.5.60.0100.07020.14
5.5.50.0100.07320.15
5.5.40.0000.06020.14
5.5.30.0070.08720.07
5.5.20.0170.06720.16
5.5.10.0100.07320.04
5.5.00.0070.08020.09
5.4.450.0030.04719.38
5.4.440.0030.05719.47
5.4.430.0070.07719.43
5.4.420.0100.06019.17
5.4.410.0000.05319.41
5.4.400.0070.06019.14
5.4.390.0030.04719.10
5.4.380.0100.07318.88
5.4.370.0100.07319.16
5.4.360.0070.05719.05
5.4.350.0030.04719.16
5.4.340.0130.04019.04
5.4.320.0030.07718.88
5.4.310.0070.06718.90
5.4.300.0170.06019.02
5.4.290.0100.07319.22
5.4.280.0070.05019.04
5.4.270.0100.08718.95
5.4.260.0130.06318.91
5.4.250.0030.05319.12
5.4.240.0130.06019.16
5.4.230.0100.07019.12
5.4.220.0070.08018.84
5.4.210.0100.06719.13
5.4.200.0070.04719.09
5.4.190.0100.03719.13
5.4.180.0200.06319.13
5.4.170.0030.07319.11
5.4.160.0000.08719.19
5.4.150.0170.06319.08
5.4.140.0030.04316.25
5.4.130.0030.07316.43
5.4.120.0130.06716.38
5.4.110.0070.06016.42
5.4.100.0070.07716.39
5.4.90.0030.05016.55
5.4.80.0130.06716.47
5.4.70.0100.06716.47
5.4.60.0030.07316.46
5.4.50.0070.05716.44
5.4.40.0100.03716.39
5.4.30.0030.03716.33
5.4.20.0030.03716.30
5.4.10.0000.04016.45
5.4.00.0030.03715.80
5.3.290.0030.06314.64
5.3.280.0000.05014.63
5.3.270.0100.03714.68
5.3.260.0130.06314.68
5.3.250.0070.05014.54
5.3.240.0130.06714.54
5.3.230.0030.06314.58
5.3.220.0000.07714.52
5.3.210.0130.07714.53
5.3.200.0130.07014.52
5.3.190.0030.05314.64
5.3.180.0170.04014.54
5.3.170.0000.08014.52
5.3.160.0070.08014.63
5.3.150.0030.03714.60
5.3.140.0170.03014.61
5.3.130.0000.04014.70
5.3.120.0030.03714.70
5.3.110.0030.04314.61
5.3.100.0000.04014.11
5.3.90.0000.04014.01
5.3.80.0030.03713.93
5.3.70.0030.03714.09
5.3.60.0100.03314.00
5.3.50.0030.04013.95
5.3.40.0070.03314.10
5.3.30.0000.04013.84
5.3.20.0000.04013.71
5.3.10.0000.04013.80
5.3.00.0000.03713.64
5.2.170.0030.03313.64
5.2.160.0030.03013.64
5.2.150.0100.03013.64
5.2.140.0000.03013.64
5.2.130.0000.03013.64
5.2.120.0030.05713.64
5.2.110.0030.03013.64
5.2.100.0030.02713.64
5.2.90.0000.03013.64
5.2.80.0000.03313.64
5.2.70.0100.02013.64
5.2.60.0030.02713.64
5.2.50.0000.03013.64
5.2.40.0000.03713.64
5.2.30.0030.02313.64
5.2.20.0030.03313.64
5.2.10.0030.02713.64
5.2.00.0030.03013.64
5.1.60.0030.02313.64
5.1.50.0030.02313.64
5.1.40.0030.02313.64
5.1.30.0030.02713.64
5.1.20.0030.03013.64
5.1.10.0030.02713.64
5.1.00.0000.02713.64
5.0.50.0000.02013.64
5.0.40.0000.01713.64
5.0.30.0000.03313.64
5.0.20.0030.02713.64
5.0.10.0000.02313.64
5.0.00.0000.03013.64
4.4.90.0030.03313.64
4.4.80.0070.01013.64
4.4.70.0000.03713.64
4.4.60.0000.01713.64
4.4.50.0070.01013.64
4.4.40.0030.02013.64
4.4.30.0000.01713.64
4.4.20.0000.02313.64
4.4.10.0000.02013.64
4.4.00.0000.02713.64
4.3.110.0000.01713.64
4.3.100.0000.01713.64
4.3.90.0030.01013.64
4.3.80.0000.03013.64
4.3.70.0030.01013.64
4.3.60.0000.01313.64
4.3.50.0000.01713.64
4.3.40.0000.02713.64
4.3.30.0000.01713.64
4.3.20.0000.01713.64
4.3.10.0000.01713.64
4.3.00.0000.01313.64

preferences:
46.13 ms | 400 KiB | 5 Q