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>")]; unserialize(serialize(new Post("hue", "br", [new Filter("/gibe/", "gibe moni"), new Filter("/moni/", "i repor u")]))); unserialize('O:4:"Post":3:{s:8:"*title";s:3:"hue";s:7:"*text";s:2:"br";s:10:"*filters";a:2:{i:0;O:6:"Filter":2:{s:10:"*pattern";s:6:"/gibe/";s:7:"*repl";s:9:"gibe moni";}i:1;O:6:"Filter":2:{s:10:"*pattern";s:6:"/moni/";s:7:"*repl";s:9:"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.0070.00718.43
8.3.50.0070.01116.54
8.3.40.0120.00318.95
8.3.30.0110.00319.21
8.3.20.0040.00420.39
8.3.10.0000.00823.59
8.3.00.0060.00319.63
8.2.180.0100.00717.13
8.2.170.0180.00322.96
8.2.160.0070.00720.44
8.2.150.0040.00424.18
8.2.140.0000.00824.66
8.2.130.0020.00526.16
8.2.120.0030.00622.23
8.2.110.0080.00319.45
8.2.100.0090.00318.16
8.2.90.0050.00519.34
8.2.80.0040.00417.97
8.2.70.0030.00517.74
8.2.60.0050.00317.93
8.2.50.0030.00518.07
8.2.40.0040.00419.88
8.2.30.0040.00418.16
8.2.20.0030.00517.80
8.2.10.0000.00818.05
8.2.00.0000.00817.84
8.1.280.0090.00625.92
8.1.270.0030.00623.91
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0090.00023.83
8.1.230.0090.00317.52
8.1.220.0000.00817.74
8.1.210.0080.00018.77
8.1.200.0030.00717.50
8.1.190.0090.00017.47
8.1.180.0060.00318.10
8.1.170.0000.00918.77
8.1.160.0000.00721.94
8.1.150.0000.00818.86
8.1.140.0060.00317.66
8.1.130.0000.00717.75
8.1.120.0080.00017.56
8.1.110.0040.00417.62
8.1.100.0040.00417.55
8.1.90.0060.00317.56
8.1.80.0000.00717.53
8.1.70.0000.00717.61
8.1.60.0090.00017.73
8.1.50.0030.00517.74
8.1.40.0030.00517.67
8.1.30.0060.00317.73
8.1.20.0060.00317.79
8.1.10.0040.00417.63
8.1.00.0050.00317.73
8.0.300.0000.00718.77
8.0.290.0000.00816.88
8.0.280.0000.00718.50
8.0.270.0070.00017.34
8.0.260.0030.00317.22
8.0.250.0000.00717.20
8.0.240.0070.00017.10
8.0.230.0090.00017.17
8.0.220.0070.00017.10
8.0.210.0040.00417.02
8.0.200.0000.00817.16
8.0.190.0090.00017.17
8.0.180.0000.00817.18
8.0.170.0050.00217.15
8.0.160.0030.00517.14
8.0.150.0020.00516.98
8.0.140.0060.00317.04
8.0.130.0000.00613.62
8.0.120.0000.00816.97
8.0.110.0040.00417.01
8.0.100.0050.00217.06
8.0.90.0000.00716.96
8.0.80.0100.00617.18
8.0.70.0000.00717.19
8.0.60.0040.00416.95
8.0.50.0000.00717.11
8.0.30.0110.01117.34
8.0.20.0150.00817.58
8.0.10.0000.00717.14
8.0.00.0100.00917.11
7.4.330.0000.00615.02
7.4.320.0060.00016.75
7.4.300.0040.00416.78
7.4.290.0030.00316.73
7.4.280.0030.00716.77
7.4.270.0080.00016.73
7.4.260.0050.00216.74
7.4.250.0070.00016.83
7.4.240.0030.00516.74
7.4.230.0000.00716.60
7.4.220.0060.01216.78
7.4.210.0070.01016.88
7.4.200.0040.00416.82
7.4.160.0120.00416.77
7.4.150.0120.00617.40
7.4.140.0120.01217.86
7.4.130.0110.00716.81
7.4.120.0120.00916.79
7.4.110.0150.00316.89
7.4.100.0110.00716.72
7.4.90.0130.00416.77
7.4.80.0070.01019.39
7.4.70.0060.01016.93
7.4.60.0150.00616.71
7.4.50.0060.00316.69
7.4.40.0000.01816.56
7.4.30.0100.01016.72
7.4.00.0090.00615.28
7.3.330.0050.00013.33
7.3.320.0030.00313.54
7.3.310.0000.00716.44
7.3.300.0000.00716.62
7.3.290.0040.01016.54
7.3.280.0080.00816.55
7.3.270.0110.00717.40
7.3.260.0120.00616.66
7.3.250.0060.01216.66
7.3.240.0090.00916.91
7.3.230.0140.00416.71
7.3.210.0140.00316.83
7.3.200.0150.00619.39
7.3.190.0130.01016.54
7.3.180.0160.00016.95
7.3.170.0120.00616.65
7.3.160.0100.00616.54
7.3.10.0030.00716.68
7.3.00.0000.01316.74
7.2.330.0090.00916.88
7.2.320.0160.00616.95
7.2.310.0110.00616.91
7.2.300.0030.01316.88
7.2.290.0180.00416.95
7.2.130.0030.00917.09
7.2.120.0000.01017.20
7.2.110.0000.00916.94
7.2.100.0030.00616.82
7.2.90.0030.00616.93
7.2.80.0070.00716.89
7.2.70.0000.01217.05
7.2.60.0080.00817.02
7.2.50.0030.00617.24
7.2.40.0040.00817.00
7.2.30.0100.00317.07
7.2.20.0090.00017.30
7.2.10.0080.00417.19
7.2.00.0100.00518.38
7.1.250.0040.00715.93
7.1.200.0100.00016.07
7.1.100.0030.01318.26
7.1.70.0150.00617.21
7.1.60.0070.01719.11
7.1.50.0040.01816.89
7.1.00.0030.07722.35
7.0.200.0070.00716.82
7.0.140.0030.07322.16
7.0.60.0170.07319.94
7.0.50.0100.05717.91
7.0.40.0070.04320.17
7.0.30.0330.07020.31
7.0.20.0130.05320.31
7.0.10.0130.05720.13
7.0.00.0130.07720.31
5.6.280.0070.07020.91
5.6.210.0070.08020.74
5.6.200.0030.04318.22
5.6.190.0000.07020.49
5.6.180.0270.07320.57
5.6.170.0270.03320.43
5.6.160.0100.04020.54
5.6.150.0100.04318.19
5.6.140.0070.08018.16
5.6.130.0000.08318.18
5.6.120.0000.04721.00
5.6.110.0030.09021.00
5.6.100.0030.04721.00
5.6.90.0130.07720.98
5.6.80.0100.07720.43
5.6.70.3170.04020.29
5.5.350.0100.09020.36
5.5.340.0070.07717.98
5.5.330.0130.04320.30
5.5.320.0200.05320.36
5.5.310.0230.08020.28
5.5.300.0030.07317.98
5.5.290.0100.07317.95
5.5.280.0070.08320.63
5.5.270.0030.06720.86
5.5.260.0070.08320.85
5.5.250.0030.05720.51
5.5.240.0300.07320.39
5.4.450.0070.06019.19
5.4.440.0870.05719.54
5.4.430.0570.06719.42
5.4.420.0670.00019.36
5.4.410.0630.00019.27
5.4.400.0700.00019.09
5.4.390.0700.00019.16
5.4.380.0670.00019.26
5.4.370.0630.00019.02
5.4.360.0700.00019.07
5.4.350.0670.00019.04
5.4.340.0060.03412.04
5.4.320.0040.03712.53
5.4.310.0050.03812.52
5.4.300.0050.03712.54
5.4.290.0100.03512.52
5.4.280.0060.03612.42
5.4.270.0040.03812.42
5.4.260.0050.03712.42
5.4.250.0050.04012.42
5.4.240.0030.04012.42
5.4.230.0070.03712.41
5.4.220.0070.03612.41
5.4.210.0050.03612.40
5.4.200.0080.03912.41
5.4.190.0050.03712.40
5.4.180.0040.04312.41
5.4.170.0070.04112.41
5.4.160.0100.03112.41
5.4.150.0080.03612.41
5.4.140.0060.04012.09
5.4.130.0070.03412.08
5.4.120.0070.03512.04
5.4.110.0070.03312.03
5.4.100.0090.03612.04
5.4.90.0030.04112.03
5.4.80.0070.03612.04
5.4.70.0060.03612.03
5.4.60.0050.04112.03
5.4.50.0050.03612.03
5.4.40.0070.03612.03
5.4.30.0060.03612.02
5.4.20.0080.03612.02
5.4.10.0110.03912.03
5.4.00.0090.04011.52
5.3.290.0070.03912.80
5.3.280.0090.03612.70
5.3.270.0130.03512.72
5.3.260.0100.04212.72
5.3.250.0100.03712.71
5.3.240.0080.03912.72
5.3.230.0110.03512.71
5.3.220.0040.03912.68
5.3.210.0080.03812.68
5.3.200.0060.03612.68
5.3.190.0080.03912.68
5.3.180.0120.03412.67
5.3.170.0040.04012.67
5.3.160.0090.03712.67
5.3.150.0050.04112.67
5.3.140.0060.03612.66
5.3.130.0070.03912.65
5.3.120.0040.04012.66
5.3.110.0040.05112.66
5.3.100.0040.04012.14
5.3.90.0100.04612.12
5.3.80.0070.04112.11
5.3.70.0070.04312.11
5.3.60.0050.03912.09
5.3.50.0120.03912.04
5.3.40.0090.03312.04
5.3.30.0120.03212.00
5.3.20.0070.03611.78
5.3.10.0090.03511.75
5.3.00.0070.03711.73
5.2.170.0060.0349.24
5.2.160.0070.0389.24
5.2.150.0060.0299.24
5.2.140.0060.0299.24
5.2.130.0060.0289.20
5.2.120.0050.0279.20
5.2.110.0020.0319.20
5.2.100.0050.0309.20
5.2.90.0060.0309.20
5.2.80.0040.0339.20
5.2.70.0050.0359.20
5.2.60.0020.0369.16
5.2.50.0090.0329.12
5.2.40.0050.0289.10
5.2.30.0040.0349.07
5.2.20.0090.0289.05
5.2.10.0070.0348.97
5.2.00.0040.0318.83
5.1.60.0040.0248.11
5.1.50.0040.0258.11
5.1.40.0030.0268.09
5.1.30.0050.0268.45
5.1.20.0020.0288.46
5.1.10.0060.0328.18
5.1.00.0060.0238.19
5.0.50.0080.0226.67
5.0.40.0040.0206.52
5.0.30.0040.0316.33
5.0.20.0050.0196.30
5.0.10.0030.0206.29
5.0.00.0050.0316.28
4.4.90.0040.0194.78
4.4.80.0040.0194.76
4.4.70.0050.0144.76
4.4.60.0030.0164.75
4.4.50.0040.0154.77
4.4.40.0040.0254.71
4.4.30.0030.0154.75
4.4.20.0040.0224.85
4.4.10.0020.0204.85
4.4.00.0030.0254.76
4.3.110.0060.0144.67
4.3.100.0020.0154.67
4.3.90.0070.0254.64
4.3.80.0040.0264.59
4.3.70.0030.0144.63
4.3.60.0010.0164.63
4.3.50.0020.0164.63
4.3.40.0020.0294.54
4.3.30.0020.0283.30
4.3.20.0030.0153.28
4.3.10.0010.0203.24
4.3.00.0130.0236.64

preferences:
41.43 ms | 400 KiB | 5 Q