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.0000.01518.55
8.3.50.0100.01021.23
8.3.40.0180.00019.13
8.3.30.0140.00019.05
8.3.20.0040.00420.23
8.3.10.0040.00423.53
8.3.00.0080.00019.52
8.2.180.0160.00016.74
8.2.170.0110.00422.96
8.2.160.0100.00320.39
8.2.150.0030.00524.18
8.2.140.0000.00824.66
8.2.130.0080.00026.16
8.2.120.0180.00022.09
8.2.110.0090.00021.19
8.2.100.0060.00618.09
8.2.90.0040.00417.84
8.2.80.0060.00317.97
8.2.70.0030.00517.92
8.2.60.0040.00417.93
8.2.50.0050.00318.07
8.2.40.0040.00418.22
8.2.30.0000.00918.20
8.2.20.0040.00418.05
8.2.10.0040.00418.04
8.2.00.0000.00717.92
8.1.280.0070.01125.92
8.1.270.0060.00323.84
8.1.260.0080.00026.35
8.1.250.0060.00328.09
8.1.240.0060.00319.44
8.1.230.0030.00719.15
8.1.220.0040.00417.78
8.1.210.0040.00418.77
8.1.200.0030.00617.48
8.1.190.0030.00617.38
8.1.180.0040.00418.10
8.1.170.0120.00318.26
8.1.160.0040.00418.89
8.1.150.0040.00418.89
8.1.140.0030.00617.55
8.1.130.0000.00717.87
8.1.120.0000.00717.58
8.1.110.0040.00417.67
8.1.100.0000.00717.68
8.1.90.0040.00417.61
8.1.80.0040.00417.56
8.1.70.0040.00417.56
8.1.60.0030.00617.66
8.1.50.0030.00517.74
8.1.40.0060.00317.70
8.1.30.0060.00317.83
8.1.20.0090.00017.84
8.1.10.0050.00317.69
8.1.00.0050.00317.69
8.0.300.0070.00018.77
8.0.290.0070.00017.13
8.0.280.0000.00718.50
8.0.270.0030.00317.21
8.0.260.0070.00017.21
8.0.250.0000.00817.06
8.0.240.0030.00317.23
8.0.230.0070.00317.16
8.0.220.0040.00417.17
8.0.210.0040.00417.13
8.0.200.0030.00317.20
8.0.190.0000.00917.14
8.0.180.0040.00417.09
8.0.170.0040.00417.12
8.0.160.0040.00417.04
8.0.150.0080.00017.09
8.0.140.0000.00816.98
8.0.130.0000.00613.60
8.0.120.0040.00417.00
8.0.110.0040.00417.10
8.0.100.0000.00717.07
8.0.90.0040.00417.16
8.0.80.0060.00917.19
8.0.70.0000.00717.00
8.0.60.0050.00317.04
8.0.50.0050.00317.16
8.0.30.0080.01317.16
8.0.20.0110.00917.40
8.0.10.0000.00717.09
8.0.00.0070.01117.03
7.4.330.0000.00515.02
7.4.320.0040.00416.84
7.4.300.0030.00316.73
7.4.290.0070.00016.77
7.4.280.0030.00716.63
7.4.270.0040.00416.73
7.4.260.0030.00616.72
7.4.250.0060.00316.79
7.4.240.0010.00616.86
7.4.230.0000.00716.65
7.4.220.0090.00916.70
7.4.210.0060.00916.63
7.4.200.0040.00416.73
7.4.160.0140.00716.87
7.4.150.0140.00617.40
7.4.140.0180.00617.86
7.4.130.0070.01016.71
7.4.120.0110.00716.84
7.4.110.0060.01516.79
7.4.100.0030.01416.83
7.4.90.0070.01016.91
7.4.80.0190.00419.39
7.4.70.0130.00516.66
7.4.60.0070.01216.83
7.4.50.0030.00616.67
7.4.40.0090.00916.76
7.4.30.0030.01716.51
7.4.10.0070.01315.25
7.4.00.0090.00715.34
7.3.330.0030.00313.55
7.3.320.0050.00013.59
7.3.310.0040.00416.67
7.3.300.0030.00316.52
7.3.290.0060.00816.54
7.3.280.0090.00916.55
7.3.270.0140.00617.40
7.3.260.0080.00916.82
7.3.250.0140.00416.73
7.3.240.0140.01416.96
7.3.230.0130.00516.68
7.3.210.0100.00717.03
7.3.200.0140.00319.39
7.3.190.0040.01416.55
7.3.180.0140.00416.70
7.3.170.0040.01416.75
7.3.160.0070.01016.77
7.3.130.0110.00814.77
7.3.120.0030.01415.03
7.3.110.0070.00815.31
7.3.100.0050.00715.12
7.3.90.0090.00515.03
7.3.80.0100.00515.20
7.3.70.0040.00914.91
7.3.60.0070.00815.10
7.3.50.0050.00715.01
7.3.40.0090.00515.07
7.3.30.0070.00714.78
7.3.20.0100.00416.70
7.3.10.0040.00816.96
7.3.00.0050.00716.90
7.2.330.0030.01416.93
7.2.320.0070.01716.96
7.2.310.0110.00616.95
7.2.300.0120.00616.77
7.2.290.0070.01717.04
7.2.260.0040.01415.39
7.2.250.0060.01115.38
7.2.240.0060.01115.27
7.2.230.0020.01215.20
7.2.220.0070.00915.25
7.2.210.0050.01115.39
7.2.200.0050.00915.17
7.2.190.0090.00615.31
7.2.180.0060.00815.03
7.2.170.0070.00515.22
7.2.160.0100.00715.05
7.2.150.0060.00616.98
7.2.140.0030.01217.01
7.2.130.0030.00716.97
7.2.120.0040.01116.94
7.2.110.0000.01217.17
7.2.100.0070.00717.22
7.2.90.0060.00917.32
7.2.80.0070.01117.27
7.2.70.0120.00616.92
7.2.60.0060.00617.17
7.2.50.0030.01316.99
7.2.40.0100.00317.30
7.2.30.0030.01316.88
7.2.20.0090.00617.17
7.2.10.0070.00717.18
7.2.00.0170.00718.34
7.1.330.0080.00716.17
7.1.320.0030.01216.03
7.1.310.0060.01116.15
7.1.300.0070.00515.85
7.1.290.0050.00715.92
7.1.280.0050.00816.11
7.1.270.0050.00715.91
7.1.260.0020.01216.04
7.1.250.0080.00415.90
7.1.240.0000.01416.17
7.1.230.0110.00315.68
7.1.220.0040.00715.91
7.1.210.0120.00416.11
7.1.200.0040.00816.00
7.1.190.0040.01415.87
7.1.180.0060.00616.07
7.1.170.0040.00816.16
7.1.160.0030.00816.09
7.1.150.0090.00615.88
7.1.140.0070.00416.17
7.1.130.0060.01116.15
7.1.120.0100.01016.05
7.1.110.0070.01115.87
7.1.100.0080.00317.35
7.1.90.0060.00916.12
7.1.80.0080.00416.07
7.1.70.0080.01116.51
7.1.60.0130.00617.46
7.1.50.0050.01116.71
7.1.40.0120.00316.09
7.1.30.0030.00716.02
7.1.20.0080.00415.62
7.1.10.0140.00016.13
7.1.00.0030.04219.02
7.0.330.0060.00615.34
7.0.320.0070.00715.25
7.0.310.0100.00615.47
7.0.300.0060.00615.34
7.0.290.0060.00615.41
7.0.280.0030.01015.84
7.0.270.0100.00615.65
7.0.260.0090.00915.50
7.0.250.0060.01215.51
7.0.240.0090.00615.65
7.0.230.0030.00815.65
7.0.220.0070.00315.62
7.0.210.0070.00715.53
7.0.200.0020.00816.21
7.0.190.0030.01015.43
7.0.180.0000.01315.40
7.0.170.0100.00315.44
7.0.160.0060.00615.30
7.0.150.0000.01515.51
7.0.140.0030.03918.93
7.0.130.0060.00915.46
7.0.120.0070.00715.70
7.0.110.0030.00915.78
7.0.100.0030.00615.55
7.0.90.0040.00815.68
7.0.80.0110.00415.83
7.0.70.0030.01115.83
7.0.60.0110.04018.56
7.0.50.0100.04016.81
7.0.40.0050.03417.01
7.0.30.0160.02317.01
7.0.20.0170.03517.00
7.0.10.0050.04517.08
7.0.00.0080.04016.88
5.6.400.0040.01414.54
5.6.390.0060.00614.57
5.6.380.0160.00014.30
5.6.370.0040.01114.66
5.6.360.0080.00414.63
5.6.350.0000.01814.57
5.6.340.0060.00614.69
5.6.330.0040.01214.13
5.6.320.0060.00314.39
5.6.310.0090.00314.75
5.6.300.0000.01414.66
5.6.290.0140.00014.50
5.6.280.0050.04117.83
5.6.270.0030.00914.68
5.6.260.0090.00314.25
5.6.250.0030.00614.77
5.6.240.0030.00914.65
5.6.230.0110.00014.29
5.6.220.0060.00614.43
5.6.210.0100.02217.45
5.6.200.0070.02716.24
5.6.190.0090.04117.37
5.6.180.0170.02317.48
5.6.170.0050.03017.52
5.6.160.0050.02817.47
5.6.150.0100.04016.24
5.6.140.0050.04716.46
5.6.130.0050.03516.27
5.6.120.0070.04717.76
5.6.110.0080.04017.87
5.6.100.0070.04817.70
5.6.90.0030.04317.79
5.6.80.0080.04317.29
5.6.70.0000.01414.38
5.6.60.0030.00614.46
5.6.50.0040.01214.40
5.6.40.0000.01414.34
5.6.30.0130.00014.28
5.6.20.0060.00914.08
5.6.10.0080.00414.44
5.6.00.0050.00514.25
5.5.380.0000.01414.34
5.5.370.0030.00914.63
5.5.360.0070.01014.63
5.5.350.0120.03917.53
5.5.340.0100.04216.08
5.5.330.0180.02417.38
5.5.320.0170.04317.29
5.5.310.0150.02517.36
5.5.300.0090.02516.34
5.5.290.0100.04316.33
5.5.280.0050.02917.80
5.5.270.0050.02917.46
5.5.260.0080.03817.54
5.5.250.0080.04217.57
5.5.240.0150.03517.38
5.5.230.0100.00314.33
5.5.220.0030.00614.57
5.5.210.0000.01514.42
5.5.200.0030.01214.33
5.5.190.0030.01014.15
5.5.180.0060.00314.49
5.5.170.0030.01014.44
5.5.160.0030.01014.30
5.5.150.0100.00614.41
5.5.140.0030.01013.95
5.5.130.0100.00314.21
5.5.120.0090.00314.16
5.5.110.0030.01414.38
5.5.100.0070.00714.43
5.5.90.0040.01114.56
5.5.80.0090.00314.46
5.5.70.0030.00614.34
5.5.60.0030.01014.44
5.5.50.0030.00914.33
5.5.40.0060.00314.49
5.5.30.0040.01114.10
5.5.20.0080.00414.58
5.5.10.0050.00514.15
5.5.00.0070.00714.40
5.4.450.0420.03215.38
5.4.440.0330.03015.48
5.4.430.0470.02915.50
5.4.420.0350.00215.39
5.4.410.0340.00215.18
5.4.400.0350.00315.09
5.4.390.0340.00215.11
5.4.380.0350.00015.09
5.4.370.0320.00215.06
5.4.360.0320.00315.08
5.4.350.0320.00415.22
5.4.340.0060.02211.56
5.4.330.0040.00411.01
5.4.320.0070.02211.85
5.4.310.0040.02311.77
5.4.300.0070.01911.82
5.4.290.0060.02411.69
5.4.280.0070.02111.90
5.4.270.0060.02111.64
5.4.260.0030.02311.81
5.4.250.0040.02311.65
5.4.240.0050.02411.91
5.4.230.0050.02111.74
5.4.220.0060.02211.73
5.4.210.0040.02811.80
5.4.200.0050.02211.83
5.4.190.0070.02511.76
5.4.180.0040.02311.66
5.4.170.0070.01911.68
5.4.160.0050.02311.64
5.4.150.0070.02111.65
5.4.140.0070.02311.68
5.4.130.0070.02111.63
5.4.120.0090.02111.67
5.4.110.0070.02011.70
5.4.100.0060.01811.67
5.4.90.0080.02111.60
5.4.80.0050.02311.47
5.4.70.0050.02011.51
5.4.60.0050.02111.64
5.4.50.0040.02611.58
5.4.40.0070.02211.64
5.4.30.0060.02111.45
5.4.20.0030.02411.70
5.4.10.0080.01911.63
5.4.00.0060.02211.29
5.3.290.0070.03912.80
5.3.280.0070.03912.71
5.3.270.0060.04412.73
5.3.260.0030.04512.72
5.3.250.0080.03912.72
5.3.240.0100.03512.72
5.3.230.0060.03912.71
5.3.220.0050.04212.68
5.3.210.0060.04412.68
5.3.200.0100.03912.68
5.3.190.0070.04412.68
5.3.180.0020.04312.68
5.3.170.0100.03412.67
5.3.160.0070.04312.67
5.3.150.0120.03512.67
5.3.140.0090.03812.66
5.3.130.0060.04112.65
5.3.120.0060.03912.66
5.3.110.0090.03712.66
5.3.100.0080.03812.14
5.3.90.0060.03612.12
5.3.80.0040.03812.11
5.3.70.0110.03112.11
5.3.60.0090.03712.10
5.3.50.0080.03512.04
5.3.40.0090.03412.04
5.3.30.0090.03512.00
5.3.20.0070.03611.78
5.3.10.0060.03711.75
5.3.00.0070.03711.74
5.2.170.0070.0319.24
5.2.160.0040.0319.24
5.2.150.0060.0339.24
5.2.140.0080.0299.23
5.2.130.0070.0339.20
5.2.120.0070.0339.20
5.2.110.0060.0299.21
5.2.100.0070.0269.20
5.2.90.0050.0319.20
5.2.80.0070.0319.19
5.2.70.0080.0309.19
5.2.60.0080.0329.15
5.2.50.0060.0309.12
5.2.40.0040.0319.10
5.2.30.0050.0309.07
5.2.20.0050.0329.05
5.2.10.0050.0338.97
5.2.00.0070.0288.83
5.1.60.0050.0318.12
5.1.50.0070.0278.11
5.1.40.0060.0318.09
5.1.30.0040.0268.44
5.1.20.0020.0298.46
5.1.10.0050.0278.19
5.1.00.0040.0268.19
5.0.50.0060.0196.67
5.0.40.0030.0236.53
5.0.30.0050.0356.34
5.0.20.0050.0186.30
5.0.10.0070.0216.28
5.0.00.0040.0326.28
4.4.90.0040.0144.78
4.4.80.0050.0154.76
4.4.70.0040.0154.76
4.4.60.0040.0214.75
4.4.50.0020.0164.77
4.4.40.0040.0264.70
4.4.30.0060.0144.76
4.4.20.0050.0174.85
4.4.10.0030.0224.85
4.4.00.0040.0274.76
4.3.110.0030.0154.67
4.3.100.0020.0164.67
4.3.90.0030.0154.64
4.3.80.0020.0254.58
4.3.70.0020.0164.63
4.3.60.0050.0124.63
4.3.50.0030.0154.63
4.3.40.0040.0244.54
4.3.30.0050.0133.30
4.3.20.0040.0143.28
4.3.10.0020.0173.23
4.3.00.0170.0176.63

preferences:
38.89 ms | 401 KiB | 5 Q