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>")]; 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:12:"/get shrekt/";s:7:"*repl";s:8:"get rekt";}i:1;O:6:"Filter":2:{s:10:"*pattern";s:5:"/hue/";s:7:"*repl";s:2:"br";}}}');

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.0090.00616.50
8.3.60.0060.00918.56
8.3.50.0150.00621.08
8.3.40.0120.00618.92
8.3.30.0140.00019.09
8.3.20.0040.00420.19
8.3.10.0070.00023.66
8.3.00.0080.00019.51
8.2.180.0090.00616.75
8.2.170.0110.00422.96
8.2.160.0100.00320.23
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0000.00722.18
8.2.110.0060.00322.10
8.2.100.0130.00019.60
8.2.90.0090.00019.16
8.2.80.0060.00317.97
8.2.70.0060.00317.50
8.2.60.0040.00417.92
8.2.50.0080.00018.07
8.2.40.0000.00820.00
8.2.30.0040.00418.21
8.2.20.0000.00817.71
8.2.10.0000.00718.06
8.2.00.0030.00517.65
8.1.280.0060.01225.92
8.1.270.0040.00423.84
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0060.00322.55
8.1.230.0030.00917.42
8.1.220.0030.00517.74
8.1.210.0040.00418.77
8.1.200.0030.00617.13
8.1.190.0080.00017.35
8.1.180.0000.00818.10
8.1.170.0090.00618.41
8.1.160.0000.00822.05
8.1.150.0050.00318.89
8.1.140.0040.00417.54
8.1.130.0050.00317.77
8.1.120.0030.00617.43
8.1.110.0030.00517.35
8.1.100.0000.00717.43
8.1.90.0030.00517.50
8.1.80.0030.00517.52
8.1.70.0020.00517.48
8.1.60.0040.00417.68
8.1.50.0040.00417.53
8.1.40.0000.00817.48
8.1.30.0000.00817.67
8.1.20.0040.00417.65
8.1.10.0030.00517.65
8.1.00.0030.00617.51
8.0.300.0090.00018.77
8.0.290.0080.00016.88
8.0.280.0030.00318.53
8.0.270.0050.00317.17
8.0.260.0030.00317.23
8.0.250.0070.00017.08
8.0.240.0000.00717.10
8.0.230.0090.00017.05
8.0.220.0070.00016.99
8.0.210.0000.00817.01
8.0.200.0030.00316.99
8.0.190.0040.00417.02
8.0.180.0050.00217.02
8.0.170.0000.00916.95
8.0.160.0050.00217.08
8.0.150.0040.00416.94
8.0.140.0040.00416.82
8.0.130.0000.00613.40
8.0.120.0000.00816.84
8.0.110.0040.00416.93
8.0.100.0000.00816.98
8.0.90.0040.00417.11
8.0.80.0110.00716.97
8.0.70.0040.00416.86
8.0.60.0000.00816.83
8.0.50.0000.00817.04
8.0.30.0110.00917.24
8.0.20.0100.01017.40
8.0.10.0000.00717.00
8.0.00.0100.00716.81
7.4.330.0000.00615.02
7.4.320.0030.00316.42
7.4.300.0040.00416.63
7.4.290.0050.00316.65
7.4.280.0060.00316.68
7.4.270.0070.00016.66
7.4.260.0040.00216.52
7.4.250.0000.00716.65
7.4.240.0080.00016.50
7.4.230.0070.00016.65
7.4.220.0050.01416.42
7.4.210.0030.01116.59
7.4.200.0030.00316.52
7.4.160.0070.01316.56
7.4.150.0150.00317.40
7.4.140.0090.01017.86
7.4.130.0130.00516.71
7.4.120.0140.00916.54
7.4.110.0030.01716.63
7.4.100.0170.00016.57
7.4.90.0080.00916.50
7.4.80.0090.00619.39
7.4.70.0090.00916.70
7.4.60.0120.00416.45
7.4.50.0060.00316.59
7.4.40.0160.00616.52
7.4.30.0030.01316.48
7.4.00.0050.01214.98
7.3.330.0000.00513.26
7.3.320.0030.00213.41
7.3.310.0050.00316.44
7.3.300.0000.00716.39
7.3.290.0110.00516.38
7.3.280.0090.00716.35
7.3.270.0130.00317.40
7.3.260.0100.00716.62
7.3.250.0140.00316.44
7.3.240.0110.00616.62
7.3.230.0150.00616.58
7.3.210.0130.00316.32
7.3.200.0100.00619.39
7.3.190.0160.00616.69
7.3.180.0060.00916.57
7.3.170.0120.00416.75
7.3.160.0160.00316.54
7.3.120.0080.00914.80
7.3.110.0070.00814.79
7.3.100.0060.01014.76
7.3.90.0030.00814.99
7.3.80.0020.01114.80
7.3.70.0010.00914.87
7.3.60.0050.01014.83
7.3.50.0060.00314.81
7.3.40.0070.00514.90
7.3.30.0050.00514.92
7.3.20.0040.00916.58
7.3.10.0050.00716.72
7.3.00.0070.00616.68
7.2.330.0110.00616.48
7.2.320.0060.01016.74
7.2.310.0000.01816.67
7.2.300.0090.00916.80
7.2.290.0090.00916.56
7.2.250.0110.00415.16
7.2.240.0050.01414.96
7.2.230.0050.01114.98
7.2.220.0020.01315.16
7.2.210.0030.01015.01
7.2.200.0050.00914.98
7.2.190.0080.00515.12
7.2.180.0030.01015.02
7.2.170.0070.00614.94
7.2.60.0040.00716.74
7.1.330.0090.00515.77
7.1.320.0040.01115.79
7.1.310.0070.00615.73
7.1.300.0050.00715.66
7.1.290.0040.00915.79
7.1.280.0030.00715.47
7.1.270.0020.00715.71
7.1.260.0050.00715.67
7.1.200.0030.01015.90
7.1.70.0050.00517.25
7.1.60.0100.01419.11
7.1.50.0040.01617.01
7.1.00.0000.08022.44
7.0.200.0040.00416.94
7.0.140.0070.07022.09
7.0.60.0100.07719.88
7.0.50.0070.07317.83
7.0.40.0070.07320.11
7.0.30.0270.07720.23
7.0.20.0270.07720.23
7.0.10.0070.06320.16
7.0.00.0000.08720.10
5.6.280.0070.07020.79
5.6.210.0130.07720.62
5.6.200.0100.08318.18
5.6.190.0100.07020.64
5.6.180.0270.03720.67
5.6.170.0270.07320.54
5.6.160.0070.08720.50
5.6.150.0030.06018.16
5.6.140.0130.07018.25
5.6.130.0100.07018.28
5.6.120.0130.04021.00
5.6.110.0030.07021.04
5.6.100.0100.08321.01
5.6.90.0100.08020.98
5.6.80.0100.06320.51
5.6.70.3000.03320.54
5.5.350.0170.08020.53
5.5.340.0000.04017.97
5.5.330.0030.04020.18
5.5.320.0270.04320.34
5.5.310.0200.06020.30
5.5.300.0070.07317.95
5.5.290.0070.03717.97
5.5.280.0030.04020.81
5.5.270.0070.03720.80
5.5.260.0070.08020.95
5.5.250.0070.08720.72
5.5.240.0270.05320.25
5.4.450.0300.07019.28
5.4.440.0500.06319.56
5.4.430.0400.07019.27
5.4.420.0330.07319.47
5.4.410.0330.08019.44
5.4.400.0330.06318.86
5.4.390.0300.03719.16
5.4.380.0300.05019.16
5.4.370.0300.06319.13
5.4.360.0270.03718.88
5.4.350.0330.03019.20
5.4.340.0270.03318.99
5.4.320.0270.03719.24
5.4.310.0230.03719.07
5.4.300.0230.03718.98
5.4.290.0270.03719.31
5.4.280.0270.04318.98
5.4.270.0230.04319.18
5.4.260.0370.02719.16
5.4.250.0270.03319.08
5.4.240.0270.03319.19
5.4.230.0300.03319.08
5.4.220.0270.04019.05
5.4.210.0230.03719.23
5.4.200.0270.03319.21
5.4.190.0300.03018.97
5.4.180.0300.03019.21
5.4.170.0230.04019.14
5.4.160.0230.03318.97
5.4.150.0200.04719.20
5.4.140.0230.03316.38
5.4.130.0300.06716.34
5.4.120.0230.04016.55
5.4.110.0270.03716.51
5.4.100.0300.05016.61
5.4.90.0270.06716.31
5.4.80.0330.03716.57
5.4.70.0330.06716.54
5.4.60.0300.03316.55
5.4.50.0300.05716.18
5.4.40.0330.03316.43
5.4.30.0270.03316.54
5.4.20.0270.04016.48
5.4.10.0470.05716.56
5.4.00.0400.06315.79
5.3.290.0200.04014.70
5.3.280.0270.03714.77
5.3.270.0270.03714.70
5.3.260.0200.03714.67
5.3.250.0230.03714.73
5.3.240.0200.06014.55
5.3.230.0270.03314.53
5.3.220.0270.03714.69
5.3.210.0370.06314.56
5.3.200.0230.03714.59
5.3.190.0330.06714.57
5.3.180.0270.05314.80
5.3.170.0270.03714.60
5.3.160.0330.06714.73
5.3.150.0400.06014.63
5.3.140.0330.04314.62
5.3.130.0270.03714.57
5.3.120.0270.03714.46
5.3.110.0300.06014.57
5.3.100.0470.04713.98
5.3.90.0400.02714.05
5.3.80.0470.05714.04
5.3.70.0370.06014.03
5.3.60.0270.05013.92
5.3.50.0270.04713.93
5.3.40.0370.06713.93
5.3.30.0400.05713.93
5.3.20.0400.06013.68
5.3.10.0330.05313.75
5.3.00.0470.05713.73
5.2.170.0300.05711.16
5.2.160.0270.06011.16
5.2.150.0300.05711.08
5.2.140.0230.03711.05
5.2.130.0300.05311.20
5.2.120.0270.03011.12
5.2.110.0300.05011.19
5.2.100.0330.05311.04
5.2.90.0270.04711.12
5.2.80.0230.03711.02
5.2.70.0300.03311.02
5.2.60.0270.06311.14
5.2.50.0300.05011.04
5.2.40.0270.05711.02
5.2.30.0270.03310.99
5.2.20.0170.03711.05
5.2.10.0230.03010.96
5.2.00.0200.04010.69
5.1.60.0230.05310.65
5.1.50.0200.05710.65
5.1.40.0270.04710.65
5.1.30.0270.04710.65
5.1.20.0300.03710.65
5.1.10.0300.04310.65
5.1.00.0200.03310.65
5.0.50.0130.04010.65
5.0.40.0130.02310.65
5.0.30.0200.06010.65
5.0.20.0030.03010.65
5.0.10.0130.03310.65
5.0.00.0170.05710.65
4.4.90.0100.03710.65
4.4.80.0200.02710.65
4.4.70.0130.01310.65
4.4.60.0130.03310.65
4.4.50.0100.01710.65
4.4.40.0100.02710.65
4.4.30.0170.03310.65
4.4.20.0130.03710.65
4.4.10.0130.03310.65
4.4.00.0130.03710.65
4.3.110.0070.02310.65
4.3.100.0130.03010.65
4.3.90.0170.03010.65
4.3.80.0070.03710.65
4.3.70.0100.02010.65
4.3.60.0130.03010.65
4.3.50.0130.03310.65
4.3.40.0170.04310.65
4.3.30.0130.01710.65
4.3.20.0030.03310.65
4.3.10.0170.02710.65
4.3.00.0100.02010.65

preferences:
44.3 ms | 401 KiB | 5 Q