3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Filter { protected $pattern; protected $repl; function __construct($pattern, $repl) { $this->pattern = $pattern; $this->repl = $repl; } function filter($data) { return preg_replace($this->pattern, $this->repl, $data); } }; class Post { protected $title; protected $text; protected $filters; function __construct($title, $text, $filters) { $this->title = $title; $this->text = $text; $this->filters = $filters; } function get_title() { return htmlspecialchars($this->title); } function display_post() { $text = htmlspecialchars($this->text); foreach ($this->filters as $filter) $text = $filter->filter($text); return $text; } function __destruct() { // debugging stuff $s = "<!-- POST " . htmlspecialchars($this->title); $text = htmlspecialchars($this->text); foreach ($this->filters as $filter) $text = $filter->filter($text); $s = $s . ": " . $text; $s = $s . " -->"; echo $s; } }; $standard_filter_set = [new Filter("/\[i\](.*)\[\/i\]/i", "<i>\\1</i>"), new Filter("/\[b\](.*)\[\/b\]/i", "<b>\\1</b>"), new Filter("/\[img\](.*)\[\/img\]/i", "<img src='\\1'>"), new Filter("/\[br\]/i", "<br>")]; echo serialize(new Post("hue", "br", [new Filter(".", "huebrgibemoniploxireporu")]));

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.0070.00718.68
8.3.50.0090.00921.27
8.3.40.0130.00618.98
8.3.30.0140.00319.26
8.3.20.0040.00420.20
8.3.10.0040.00423.66
8.3.00.0050.00319.51
8.2.180.0120.00318.29
8.2.170.0140.00022.96
8.2.160.0060.00920.47
8.2.150.0050.00324.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0080.00022.08
8.2.110.0060.00322.30
8.2.100.0080.00317.75
8.2.90.0060.00319.22
8.2.80.0080.00017.97
8.2.70.0040.00817.36
8.2.60.0000.00817.93
8.2.50.0080.00018.07
8.2.40.0040.00418.28
8.2.30.0030.00618.18
8.2.20.0000.00717.60
8.2.10.0040.00418.10
8.2.00.0000.00717.61
8.1.280.0110.00425.92
8.1.270.0080.00023.89
8.1.260.0050.00326.35
8.1.250.0040.00428.09
8.1.240.0040.00423.98
8.1.230.0070.00419.14
8.1.220.0050.00317.74
8.1.210.0040.00418.77
8.1.200.0040.00817.35
8.1.190.0080.00017.22
8.1.180.0040.00418.10
8.1.170.0040.00418.65
8.1.160.0080.00022.10
8.1.150.0000.00718.93
8.1.140.0000.00817.38
8.1.130.0030.00317.93
8.1.120.0070.00017.41
8.1.110.0080.00017.41
8.1.100.0020.00517.48
8.1.90.0050.00517.55
8.1.80.0050.00217.58
8.1.70.0040.00417.52
8.1.60.0070.00417.65
8.1.50.0050.00317.56
8.1.40.0000.00817.57
8.1.30.0000.00817.63
8.1.20.0000.00717.59
8.1.10.0000.00717.63
8.1.00.0000.00817.63
8.0.300.0000.00718.77
8.0.290.0040.00416.88
8.0.280.0030.00318.49
8.0.270.0000.00717.21
8.0.260.0030.00317.34
8.0.250.0000.00717.12
8.0.240.0000.00717.07
8.0.230.0000.00817.04
8.0.220.0040.00416.98
8.0.210.0030.00316.91
8.0.200.0000.00616.98
8.0.190.0050.00516.93
8.0.180.0040.00416.98
8.0.170.0040.00417.03
8.0.160.0070.00017.04
8.0.150.0000.00716.98
8.0.140.0000.00816.98
8.0.130.0060.00013.50
8.0.120.0000.00816.88
8.0.110.0050.00216.98
8.0.100.0040.00416.89
8.0.90.0020.00516.92
8.0.80.0080.00816.91
8.0.70.0000.00717.07
8.0.60.0000.00717.13
8.0.50.0040.00416.88
8.0.30.0110.01017.15
8.0.20.0080.01117.40
8.0.10.0040.00417.19
8.0.00.0100.01016.95
7.4.330.0050.00015.02
7.4.320.0000.00716.52
7.4.300.0060.00016.54
7.4.290.0030.00316.66
7.4.280.0060.00316.66
7.4.270.0000.00716.55
7.4.260.0070.00016.50
7.4.250.0020.00516.61
7.4.240.0030.00416.66
7.4.230.0030.00416.65
7.4.220.0070.01116.52
7.4.210.0100.00316.53
7.4.200.0040.00416.45
7.4.160.0140.01116.74
7.4.150.0040.01317.40
7.4.140.0090.01117.86
7.4.130.0100.00816.59
7.4.120.0100.00816.77
7.4.110.0060.01016.54
7.4.100.0120.00616.53
7.4.90.0080.00816.80
7.4.80.0140.00319.39
7.4.70.0070.01016.71
7.4.60.0040.01316.67
7.4.50.0000.00816.52
7.4.40.0110.00616.70
7.4.30.0120.00316.63
7.4.00.0090.00315.01
7.3.330.0030.00313.33
7.3.320.0030.00313.23
7.3.310.0040.00416.41
7.3.300.0050.00216.45
7.3.290.0050.01416.40
7.3.280.0050.01116.40
7.3.270.0170.00017.40
7.3.260.0120.00916.70
7.3.250.0070.01016.42
7.3.240.0030.01316.25
7.3.230.0090.00916.45
7.3.210.0120.00416.49
7.3.200.0060.01019.39
7.3.190.0130.00316.37
7.3.180.0130.01016.66
7.3.170.0130.00316.39
7.3.160.0150.00016.74
7.2.330.0110.00616.76
7.2.320.0120.01216.79
7.2.310.0170.00516.57
7.2.300.0130.00316.52
7.2.290.0040.01516.56
7.2.60.0000.00816.91
7.1.200.0060.00615.68
7.1.70.0000.00817.24
7.1.60.0100.01319.11
7.1.50.0130.01317.11
7.1.00.0000.08022.34
7.0.200.0000.01116.82
7.0.140.0070.07021.93
7.0.60.0100.07719.99
7.0.50.0070.03717.89
7.0.40.0030.09020.18
7.0.30.0470.07020.34
7.0.20.0330.07720.19
7.0.10.0100.06320.22
7.0.00.0070.04720.06
5.6.280.0030.07021.19
5.6.210.0130.08320.54
5.6.200.0130.07718.16
5.6.190.0070.08020.47
5.6.180.0230.05020.52
5.6.170.0270.07020.39
5.6.160.0130.07720.48
5.6.150.0070.07718.19
5.6.140.0000.04318.28
5.6.130.0130.06718.15
5.6.120.0130.07721.13
5.6.110.0100.03320.95
5.6.100.0070.08020.90
5.6.90.0030.04721.11
5.6.80.0070.06720.41
5.6.70.4500.04320.35
5.5.350.0070.07020.43
5.5.340.0030.05717.98
5.5.330.0170.04720.35
5.5.320.0330.07720.27
5.5.310.0300.05720.28
5.5.300.0130.07018.02
5.5.290.0100.05318.08
5.5.280.0200.07320.79
5.5.270.0100.08320.94
5.5.260.0130.08320.90
5.5.250.0070.04020.67
5.5.240.0370.06720.14
5.4.450.0100.07319.56
5.4.440.0270.07319.55
5.4.430.0170.05319.48
5.4.420.0200.04019.17
5.4.410.0170.05719.36
5.4.400.0200.06719.00
5.4.390.0170.04319.15
5.4.380.0430.05019.22
5.4.370.0200.05319.08
5.4.360.0170.05019.08
5.4.350.0230.07319.20
5.4.340.0030.05018.83
5.4.320.0030.05019.16
5.4.310.0030.06718.98
5.4.300.0070.07019.08
5.4.290.0030.07719.15
5.4.280.0030.08018.94
5.4.270.0130.06719.24
5.4.260.0030.04318.98
5.4.250.0070.07018.97
5.4.240.0070.07718.97
5.4.230.0030.05018.98
5.4.220.0100.06319.14
5.4.210.0070.06019.14
5.4.200.0100.07319.20
5.4.190.0100.07718.84
5.4.180.0170.04319.23
5.4.170.0200.07319.21
5.4.160.0030.07019.21
5.4.150.0100.06018.97
5.4.140.0030.06016.55
5.4.130.0030.04716.50
5.4.120.0100.07016.55
5.4.110.0030.05016.40
5.4.100.0030.03716.50
5.4.90.0030.04016.33
5.4.80.0100.04316.44
5.4.70.0070.06316.29
5.4.60.0000.05016.25
5.4.50.0070.07316.17
5.4.40.0200.03716.45
5.4.30.0130.06316.48
5.4.20.0200.06316.43
5.4.10.0300.06316.43
5.4.00.0170.05715.91
5.3.290.0030.07314.90
5.3.280.0070.07014.77
5.3.270.0230.07014.54
5.3.260.0030.08014.70
5.3.250.0000.07714.84
5.3.240.0070.07014.54
5.3.230.0070.04714.50
5.3.220.0130.06014.80
5.3.210.0070.05014.50
5.3.200.0000.05314.63
5.3.190.0070.03714.66
5.3.180.0070.07314.50
5.3.170.0100.06014.55
5.3.160.0000.04314.59
5.3.150.0100.03014.58
5.3.140.0100.07014.54
5.3.130.0070.04714.46
5.3.120.0030.05314.57
5.3.110.0230.06714.55
5.3.100.0230.04314.17
5.3.90.0270.06314.08
5.3.80.0170.06314.00
5.3.70.0070.07313.95
5.3.60.0130.06313.99
5.3.50.0070.07313.87
5.3.40.0130.05014.04
5.3.30.0100.06013.82
5.3.20.0030.05713.86
5.3.10.0100.04713.79
5.3.00.0130.03713.70
5.2.170.0070.06712.16
5.2.160.0100.04712.16
5.2.150.0070.05012.16
5.2.140.0070.04012.16
5.2.130.0030.03712.16
5.2.120.0030.05012.16
5.2.110.0170.02012.16
5.2.100.0170.02712.16
5.2.90.0100.03012.16
5.2.80.0100.03012.16
5.2.70.0130.03012.16
5.2.60.0130.03312.16
5.2.50.0000.03312.16
5.2.40.0070.02712.16
5.2.30.0130.02312.16
5.2.20.0070.03312.16
5.2.10.0100.03012.16
5.2.00.0000.03312.16
5.1.60.0170.02312.16
5.1.50.0130.02312.16
5.1.40.0100.02712.16
5.1.30.0130.03012.16
5.1.20.0100.02312.16
5.1.10.0100.02712.16
5.1.00.0100.02712.16
5.0.50.0070.02012.16
5.0.40.0030.02012.16
5.0.30.0000.05012.16
5.0.20.0100.01712.16
5.0.10.0070.01312.16
5.0.00.0030.03012.16
4.4.90.0030.01312.16
4.4.80.0070.01712.16
4.4.70.0070.01312.16
4.4.60.0100.01312.16
4.4.50.0030.02012.16
4.4.40.0030.02312.16
4.4.30.0030.01312.16
4.4.20.0070.01712.16
4.4.10.0030.01712.16
4.4.00.0030.02312.16
4.3.110.0000.02012.16
4.3.100.0000.02012.16
4.3.90.0070.01312.16
4.3.80.0070.02712.16
4.3.70.0070.01312.16
4.3.60.0030.01312.16
4.3.50.0000.02712.16
4.3.40.0070.02012.16
4.3.30.0000.01712.16
4.3.20.0030.01312.16
4.3.10.0000.02012.16
4.3.00.0030.01312.16

preferences:
37.21 ms | 401 KiB | 5 Q