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("/gibe/", "gibe moni"), 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.60.0120.00318.68
8.3.50.0090.01022.24
8.3.40.0090.00619.07
8.3.30.0070.00719.04
8.3.20.0080.00020.38
8.3.10.0030.00523.48
8.3.00.0060.00319.63
8.2.180.0090.00925.92
8.2.170.0180.00322.96
8.2.160.0070.00720.43
8.2.150.0000.00824.18
8.2.140.0000.00824.66
8.2.130.0040.00426.16
8.2.120.0080.00022.28
8.2.110.0110.00722.21
8.2.100.0110.00017.88
8.2.90.0000.00819.22
8.2.80.0040.00417.97
8.2.70.0080.00017.75
8.2.60.0000.00818.03
8.2.50.0040.00418.07
8.2.40.0040.00420.07
8.2.30.0000.00818.24
8.2.20.0030.00617.88
8.2.10.0040.00418.20
8.2.00.0000.00717.88
8.1.280.0150.00025.92
8.1.270.0030.00623.97
8.1.260.0080.00026.35
8.1.250.0030.00628.09
8.1.240.0070.00323.92
8.1.230.0090.00319.27
8.1.220.0040.00417.74
8.1.210.0040.00418.77
8.1.200.0000.00917.38
8.1.190.0060.00317.60
8.1.180.0000.00818.10
8.1.170.0000.00818.86
8.1.160.0030.00522.02
8.1.150.0000.00819.00
8.1.140.0040.00417.68
8.1.130.0040.00417.74
8.1.120.0040.00417.62
8.1.110.0000.00917.64
8.1.100.0040.00317.60
8.1.90.0030.00517.55
8.1.80.0040.00417.56
8.1.70.0000.00817.54
8.1.60.0030.00617.83
8.1.50.0040.00417.62
8.1.40.0000.00817.60
8.1.30.0090.00017.81
8.1.20.0060.00317.79
8.1.10.0040.00417.64
8.1.00.0000.00817.63
8.0.300.0040.00418.77
8.0.290.0040.00417.00
8.0.280.0040.00418.51
8.0.270.0040.00417.38
8.0.260.0060.00317.29
8.0.250.0000.00717.10
8.0.240.0000.00717.25
8.0.230.0040.00417.24
8.0.220.0050.00317.15
8.0.210.0070.00017.09
8.0.200.0030.00517.19
8.0.190.0000.00917.17
8.0.180.0020.00517.18
8.0.170.0000.00817.05
8.0.160.0000.00717.14
8.0.150.0030.00617.08
8.0.140.0040.00417.09
8.0.130.0030.00313.57
8.0.120.0030.00517.12
8.0.110.0070.00016.96
8.0.100.0000.00717.18
8.0.90.0000.00717.13
8.0.80.0030.01217.11
8.0.70.0000.00817.14
8.0.60.0080.00017.14
8.0.50.0040.00417.13
8.0.30.0100.01617.18
8.0.20.0060.01417.49
8.0.10.0040.00417.31
8.0.00.0110.00616.82
7.4.330.0000.00615.02
7.4.320.0030.00316.77
7.4.300.0000.00716.86
7.4.290.0070.00016.85
7.4.280.0040.00716.76
7.4.270.0000.00716.89
7.4.260.0040.00416.83
7.4.250.0000.00816.80
7.4.240.0060.00116.76
7.4.230.0000.00716.65
7.4.220.0150.00416.84
7.4.210.0130.00716.80
7.4.200.0030.00316.67
7.4.160.0080.00816.81
7.4.150.0140.00417.40
7.4.140.0120.00717.86
7.4.130.0100.00716.85
7.4.120.0130.00516.69
7.4.110.0090.00916.76
7.4.100.0150.00916.71
7.4.90.0140.00316.93
7.4.80.0100.01019.39
7.4.70.0000.01616.79
7.4.60.0050.01216.88
7.4.50.0000.00516.80
7.4.40.0030.01516.64
7.4.30.0070.01316.64
7.4.10.0080.01215.08
7.4.00.0090.00715.29
7.3.330.0050.00013.52
7.3.320.0050.00013.54
7.3.310.0030.00616.39
7.3.300.0000.00716.53
7.3.290.0080.00916.49
7.3.280.0040.01316.57
7.3.270.0090.00917.40
7.3.260.0110.00816.60
7.3.250.0110.00616.52
7.3.240.0140.00316.90
7.3.230.0060.01216.74
7.3.210.0060.01016.45
7.3.200.0060.01219.39
7.3.190.0070.01616.77
7.3.180.0080.00816.83
7.3.170.0100.00716.79
7.3.160.0130.00316.61
7.3.130.0100.00715.04
7.3.120.0100.01015.04
7.3.110.0110.00515.06
7.3.100.0020.01114.83
7.3.90.0060.01014.79
7.3.80.0080.00514.88
7.3.70.0050.00914.98
7.3.60.0030.01015.04
7.3.50.0030.00814.86
7.3.40.0110.00614.91
7.3.30.0070.00714.91
7.3.20.0050.00816.79
7.3.10.0070.00716.94
7.3.00.0080.00816.83
7.2.330.0110.00616.93
7.2.320.0110.01116.95
7.2.310.0080.00916.75
7.2.300.0050.01116.91
7.2.290.0150.00916.80
7.2.260.0060.01315.50
7.2.250.0110.00715.24
7.2.240.0030.01315.10
7.2.230.0100.00715.29
7.2.220.0070.01115.34
7.2.210.0030.01215.03
7.2.200.0070.00715.08
7.2.190.0050.01115.17
7.2.180.0060.00515.36
7.2.170.0070.00515.42
7.2.160.0030.01315.27
7.2.150.0040.01217.21
7.2.140.0070.01117.24
7.2.130.0090.00916.90
7.2.120.0030.00917.16
7.2.110.0070.01017.30
7.2.100.0040.01217.09
7.2.90.0000.02017.12
7.2.80.0060.01316.97
7.2.70.0030.01016.86
7.2.60.0070.00717.18
7.2.50.0100.00317.16
7.2.40.0030.01317.24
7.2.30.0000.00917.02
7.2.20.0000.01517.10
7.2.10.0070.00817.16
7.2.00.0120.00617.15
7.1.330.0030.01116.09
7.1.320.0050.00915.94
7.1.310.0050.00616.02
7.1.300.0070.00715.92
7.1.290.0020.01115.99
7.1.280.0040.00815.95
7.1.270.0080.00615.99
7.1.260.0020.01216.13
7.1.250.0090.00616.04
7.1.240.0030.00916.04
7.1.230.0060.00315.83
7.1.220.0000.01116.05
7.1.210.0040.01116.21
7.1.200.0090.00615.73
7.1.190.0030.00815.96
7.1.180.0030.00615.81
7.1.170.0050.00516.12
7.1.160.0100.00715.92
7.1.150.0090.00015.79
7.1.140.0030.00915.89
7.1.130.0060.00616.07
7.1.120.0090.00615.79
7.1.110.0100.00316.14
7.1.100.0070.00817.09
7.1.90.0070.01115.83
7.1.80.0030.01015.88
7.1.70.0110.00016.69
7.1.60.0090.01217.52
7.1.50.0030.01516.55
7.1.40.0100.00315.98
7.1.30.0070.00715.79
7.1.20.0030.01015.91
7.1.10.0060.00316.13
7.1.00.0070.03719.13
7.0.330.0100.00715.27
7.0.320.0070.00715.44
7.0.310.0030.00815.66
7.0.300.0080.00815.46
7.0.290.0040.00715.84
7.0.280.0030.00615.45
7.0.270.0030.01015.79
7.0.260.0030.01015.50
7.0.250.0040.00815.52
7.0.240.0000.00915.74
7.0.230.0060.00615.79
7.0.220.0030.00815.66
7.0.210.0030.01315.30
7.0.200.0080.00316.40
7.0.190.0060.00615.59
7.0.180.0040.00815.58
7.0.170.0000.01315.66
7.0.160.0000.01415.68
7.0.150.0080.00415.59
7.0.140.0050.03818.92
7.0.130.0090.00415.73
7.0.120.0070.01015.55
7.0.110.0060.00615.75
7.0.100.0130.00015.61
7.0.90.0390.03217.81
7.0.80.0170.04417.90
7.0.70.0320.04417.77
7.0.60.0250.03217.78
7.0.50.0190.02517.90
7.0.40.0050.02516.88
7.0.30.0020.02916.73
7.0.20.0100.02116.82
7.0.10.0050.02616.76
7.0.00.0050.02316.77
5.6.400.0030.00914.38
5.6.390.0120.00614.60
5.6.380.0130.00314.51
5.6.370.0100.00314.45
5.6.360.0030.00914.40
5.6.350.0110.00614.73
5.6.340.0070.00314.69
5.6.330.0000.01314.68
5.6.320.0090.00014.49
5.6.310.0040.01114.51
5.6.300.0100.00314.58
5.6.290.0080.00014.75
5.6.280.0000.01814.17
5.6.270.0030.01614.49
5.6.260.0030.01014.46
5.6.250.0040.00814.42
5.6.240.0050.04717.43
5.6.230.0100.02317.50
5.6.220.0140.04317.55
5.6.210.0050.04517.55
5.6.200.0020.04217.86
5.6.190.0070.04018.01
5.6.180.0050.02617.84
5.6.170.0050.02817.71
5.6.160.0080.02317.78
5.6.150.0050.02817.96
5.6.140.0050.03417.71
5.6.130.0050.02817.79
5.6.120.0050.03417.84
5.6.110.0070.02317.69
5.6.100.0050.02517.71
5.6.90.0030.02717.74
5.6.80.0050.02317.36
5.6.70.0030.02117.31
5.6.60.0050.02517.39
5.6.50.0050.02217.48
5.6.40.0050.02817.37
5.6.30.0050.01917.43
5.6.20.0070.02217.37
5.6.10.0070.02217.49
5.6.00.0080.01917.58
5.5.380.0110.03217.49
5.5.370.0090.03517.27
5.5.360.0050.03817.29
5.5.350.0050.03217.32
5.5.340.0100.04217.35
5.5.330.0060.02517.59
5.5.320.0110.02417.81
5.5.310.0040.02517.62
5.5.300.0030.02517.54
5.5.290.0060.02617.73
5.5.280.0060.03017.60
5.5.270.0070.02617.72
5.5.260.0070.02417.68
5.5.250.0070.02317.64
5.5.240.0060.01817.23
5.5.230.0060.02417.19
5.5.220.0020.03017.33
5.5.210.0090.01917.39
5.5.200.0080.03517.19
5.5.190.0070.02217.21
5.5.180.0090.02817.21
5.5.170.0030.00614.26
5.5.160.0040.02217.38
5.5.150.0060.02716.99
5.5.140.0080.02017.30
5.5.130.0080.02217.27
5.5.120.0080.02017.25
5.5.110.0050.03117.37
5.5.100.0030.02017.21
5.5.90.0050.03017.18
5.5.80.0060.02017.20
5.5.70.0020.02517.25
5.5.60.0080.03117.23
5.5.50.0080.02817.32
5.5.40.0100.02317.25
5.5.30.0090.02517.15
5.5.20.0050.04317.32
5.5.10.0050.03017.12
5.5.00.0100.03517.09
5.4.450.0070.02115.54
5.4.440.0050.02515.49
5.4.430.0050.02215.48
5.4.420.0030.02515.52
5.4.410.0070.02015.50
5.4.400.0020.02215.26
5.4.390.0030.02315.30
5.4.380.0030.02515.38
5.4.370.0040.02215.23
5.4.360.0040.02215.37
5.4.350.0070.02815.27
5.4.340.0050.01815.32
5.4.330.0000.01311.61
5.4.320.0030.01815.32
5.4.310.0000.02915.36
5.4.300.0030.02115.32
5.4.290.0080.01515.31
5.4.280.0000.02315.39
5.4.270.0020.02115.37
5.4.260.0010.02415.32
5.4.250.0050.03815.32
5.4.240.0050.01815.24
5.4.230.0080.03715.35
5.4.220.0070.04015.32
5.4.210.0030.04615.36
5.4.200.0110.03715.41
5.4.190.0020.02515.36
5.4.180.0130.03715.36
5.4.170.0070.03315.40
5.4.160.0070.03915.39
5.4.150.0030.03515.31
5.4.140.0020.03414.04
5.4.130.0020.02814.03
5.4.120.0090.03514.00
5.4.110.0030.02214.06
5.4.100.0060.03414.04
5.4.90.0030.02814.05
5.4.80.0070.03514.06
5.4.70.0030.04314.04
5.4.60.0050.02513.96
5.4.50.0090.03413.97
5.4.40.0040.04113.99
5.4.30.0050.04014.01
5.4.20.0080.02214.03
5.4.10.0020.04313.99
5.4.00.0080.03213.60
5.3.290.0030.06014.60
5.3.280.0070.05314.57
5.3.270.0030.05714.73
5.3.260.0200.06714.74
5.3.250.0170.06314.74
5.3.240.0070.03714.75
5.3.230.0070.08014.62
5.3.220.0070.05014.65
5.3.210.0070.07014.67
5.3.200.0100.07014.59
5.3.190.0030.08014.64
5.3.180.0130.07014.54
5.3.170.0000.08014.61
5.3.160.0000.04014.64
5.3.150.0070.04014.70
5.3.140.0100.07014.68
5.3.130.0130.07014.52
5.3.120.0000.08014.57
5.3.110.0070.07714.63
5.3.100.0070.07313.94
5.3.90.0070.05013.96
5.3.80.0170.06014.14
5.3.70.0070.07714.05
5.3.60.0000.05713.92
5.3.50.0000.08313.99
5.3.40.0070.06714.02
5.3.30.0000.07013.90
5.3.20.0030.06013.71
5.3.10.0000.04713.64
5.3.00.0030.05713.80
5.2.170.0070.05711.15
5.2.160.0000.06711.30
5.2.150.0070.06011.21
5.2.140.0000.06311.09
5.2.130.0100.05011.25
5.2.120.0100.05011.14
5.2.110.0000.06311.02
5.2.100.0130.05011.14
5.2.90.0000.05711.02
5.2.80.0030.06311.13
5.2.70.0030.06711.09
5.2.60.0100.06011.06
5.2.50.0030.06311.13
5.2.40.0100.05311.07
5.2.30.0070.06711.05
5.2.20.0170.02311.12
5.2.10.0030.05310.93
5.2.00.0100.05710.60
5.1.60.0070.04710.02
5.1.50.0070.05710.13
5.1.40.0000.04710.11
5.1.30.0030.05010.37
5.1.20.0070.05310.44
5.1.10.0030.06010.09
5.1.00.0030.03010.20
5.0.50.0000.0438.65
5.0.40.0070.0308.46
5.0.30.0100.0578.23
5.0.20.0100.0238.25
5.0.10.0130.0338.03
5.0.00.0000.0678.19
4.4.90.0030.0337.02
4.4.80.0000.0377.02
4.4.70.0000.0377.02
4.4.60.0030.0237.02
4.4.50.0100.0307.02
4.4.40.0030.0577.02
4.4.30.0070.0337.02
4.4.20.0030.0337.02
4.4.10.0070.0137.02
4.4.00.0000.0577.02
4.3.110.0030.0277.02
4.3.100.0030.0307.02
4.3.90.0000.0377.02
4.3.80.0030.0537.02
4.3.70.0070.0337.02
4.3.60.0000.0337.02
4.3.50.0100.0237.02
4.3.40.0000.0537.02
4.3.30.0030.0337.02
4.3.20.0030.0277.02
4.3.10.0000.0407.02
4.3.00.0000.0307.02

preferences:
49.84 ms | 401 KiB | 5 Q