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>")]; echo 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.70.0090.00618.68
8.3.60.0140.00418.56
8.3.50.0100.00822.05
8.3.40.0120.00319.10
8.3.30.0070.00719.09
8.3.20.0090.00020.21
8.3.10.0040.00423.64
8.3.00.0040.00419.51
8.2.180.0120.00318.79
8.2.170.0150.00722.96
8.2.160.0110.00320.35
8.2.150.0030.00524.18
8.2.140.0080.00024.66
8.2.130.0000.00826.16
8.2.120.0080.00022.24
8.2.110.0090.00022.28
8.2.100.0060.00617.75
8.2.90.0000.00819.19
8.2.80.0030.00517.97
8.2.70.0090.00017.88
8.2.60.0080.00017.80
8.2.50.0030.00618.07
8.2.40.0000.00818.28
8.2.30.0070.00018.17
8.2.20.0000.00817.75
8.2.10.0050.00218.03
8.2.00.0040.00417.91
8.1.280.0040.01125.92
8.1.270.0080.00623.87
8.1.260.0050.00226.35
8.1.250.0040.00428.09
8.1.240.0030.00623.97
8.1.230.0120.00019.10
8.1.220.0050.00317.74
8.1.210.0060.00318.77
8.1.200.0030.00717.47
8.1.190.0000.00817.47
8.1.180.0040.00418.10
8.1.170.0060.00618.69
8.1.160.0000.00721.98
8.1.150.0040.00418.99
8.1.140.0030.00617.54
8.1.130.0030.00317.96
8.1.120.0000.00717.68
8.1.110.0080.00017.64
8.1.100.0040.00417.69
8.1.90.0000.00717.62
8.1.80.0000.00717.67
8.1.70.0030.00617.66
8.1.60.0060.00317.74
8.1.50.0050.00317.71
8.1.40.0040.00417.67
8.1.30.0030.00617.77
8.1.20.0040.00417.79
8.1.10.0040.00417.74
8.1.00.0040.00417.70
8.0.300.0000.00818.77
8.0.290.0040.00416.88
8.0.280.0000.00718.55
8.0.270.0030.00317.30
8.0.260.0000.00617.28
8.0.250.0040.00417.06
8.0.240.0000.00717.01
8.0.230.0070.00317.07
8.0.220.0060.00317.09
8.0.210.0070.00017.09
8.0.200.0030.00317.01
8.0.190.0000.00817.16
8.0.180.0070.00017.06
8.0.170.0040.00417.13
8.0.160.0040.00417.13
8.0.150.0050.00317.11
8.0.140.0040.00416.90
8.0.130.0030.00313.48
8.0.120.0070.00016.99
8.0.110.0050.00217.09
8.0.100.0030.00517.04
8.0.90.0000.00716.91
8.0.80.0090.00617.11
8.0.70.0040.00417.01
8.0.60.0080.00016.90
8.0.50.0040.00417.00
8.0.30.0130.00717.24
8.0.20.0130.00617.40
8.0.10.0040.00417.04
8.0.00.0080.01116.93
7.4.330.0000.00515.02
7.4.320.0070.00016.66
7.4.300.0000.00616.81
7.4.290.0030.00316.69
7.4.280.0040.00716.74
7.4.270.0000.00816.69
7.4.260.0030.00316.70
7.4.250.0000.00816.69
7.4.240.0070.00016.73
7.4.230.0000.00716.86
7.4.220.0070.01416.77
7.4.210.0070.01016.66
7.4.200.0070.00016.93
7.4.160.0040.01216.82
7.4.150.0100.01017.40
7.4.140.0110.01117.86
7.4.130.0110.00616.74
7.4.120.0100.01116.74
7.4.110.0120.00616.44
7.4.100.0040.01316.88
7.4.90.0070.01016.93
7.4.80.0120.00619.39
7.4.70.0120.00916.75
7.4.60.0160.00216.85
7.4.50.0000.00816.67
7.4.40.0080.00816.68
7.4.30.0060.01016.71
7.4.00.0090.00815.22
7.3.330.0000.00513.46
7.3.320.0030.00313.46
7.3.310.0000.00716.31
7.3.300.0040.00416.52
7.3.290.0060.00816.50
7.3.280.0080.01116.41
7.3.270.0150.00417.40
7.3.260.0120.01016.50
7.3.250.0150.00316.59
7.3.240.0030.01316.70
7.3.230.0060.01416.84
7.3.210.0090.00916.54
7.3.200.0100.01019.39
7.3.190.0170.00616.81
7.3.180.0060.01016.47
7.3.170.0100.00616.40
7.3.160.0110.00616.75
7.3.120.0080.00815.01
7.3.110.0110.00314.93
7.3.100.0030.01315.09
7.3.90.0080.00714.92
7.3.80.0100.00314.83
7.3.70.0030.01014.95
7.3.60.0040.01114.95
7.3.50.0070.00714.94
7.3.40.0090.00714.88
7.3.30.0070.00814.85
7.3.20.0080.00516.71
7.3.10.0070.00716.72
7.3.00.0080.00716.73
7.2.330.0100.00716.68
7.2.320.0090.00916.96
7.2.310.0050.01116.99
7.2.300.0070.01016.90
7.2.290.0030.01716.78
7.2.250.0070.01115.32
7.2.240.0080.01015.42
7.2.230.0080.00815.35
7.2.220.0030.01215.15
7.2.210.0040.01015.26
7.2.200.0030.01515.10
7.2.190.0020.01215.13
7.2.180.0100.00515.11
7.2.170.0050.00815.24
7.2.160.0080.00415.13
7.2.150.0080.00516.88
7.2.140.0040.01516.86
7.2.130.0060.00517.02
7.2.120.0080.00516.95
7.2.110.0040.01117.05
7.2.100.0060.00916.86
7.2.90.0080.00617.29
7.2.80.0090.00717.14
7.2.70.0130.00317.26
7.2.60.0080.00816.98
7.2.50.0040.00717.15
7.2.40.0090.00417.29
7.2.30.0040.01216.91
7.2.20.0080.00517.00
7.2.10.0050.00917.03
7.2.00.0070.01017.11
7.1.330.0050.01115.99
7.1.320.0120.01015.92
7.1.310.0060.01015.87
7.1.300.0070.00815.84
7.1.290.0090.00715.94
7.1.280.0120.00615.66
7.1.270.0070.00715.85
7.1.260.0080.00815.98
7.1.250.0040.00615.89
7.1.240.0080.00816.03
7.1.230.0060.00315.91
7.1.220.0100.00315.71
7.1.210.0040.00815.91
7.1.200.0030.00816.10
7.1.190.0040.00416.14
7.1.180.0000.00915.96
7.1.170.0100.00315.80
7.1.160.0040.01115.91
7.1.150.0090.00615.90
7.1.140.0000.01315.75
7.1.130.0000.01415.95
7.1.120.0070.00715.81
7.1.110.0060.00315.98
7.1.100.0070.00716.14
7.1.90.0090.00615.72
7.1.80.0100.00315.83
7.1.70.0090.00316.58
7.1.60.0100.01017.52
7.1.50.0060.01116.52
7.1.40.0090.00916.08
7.1.30.0030.01315.92
7.1.20.0100.00716.16
7.1.10.0040.01116.01
7.1.00.0100.03819.25
7.0.330.0030.00615.37
7.0.320.0060.00815.47
7.0.310.0030.00715.71
7.0.300.0080.00315.43
7.0.290.0060.00315.27
7.0.280.0030.01315.62
7.0.270.0070.00415.76
7.0.260.0090.00615.66
7.0.250.0070.00715.41
7.0.240.0030.00615.35
7.0.230.0040.00415.44
7.0.220.0030.01015.78
7.0.210.0080.00415.49
7.0.200.0020.00616.26
7.0.190.0070.00715.72
7.0.180.0070.00715.46
7.0.170.0030.01315.74
7.0.160.0040.01115.64
7.0.150.0030.00615.63
7.0.140.0070.03718.81
7.0.130.0030.00615.64
7.0.120.0080.00415.65
7.0.110.0030.00715.62
7.0.100.0060.01015.30
7.0.90.0070.00715.59
7.0.80.0090.00615.38
7.0.70.0090.00615.50
7.0.60.0030.03417.74
7.0.50.0110.03716.83
7.0.40.0090.03216.96
7.0.30.0120.02616.95
7.0.20.0070.02716.95
7.0.10.0120.04216.89
7.0.00.0030.04816.87
5.6.400.0030.00914.43
5.6.390.0070.00714.47
5.6.380.0150.00014.41
5.6.370.0080.00514.37
5.6.360.0060.00614.00
5.6.350.0040.01114.61
5.6.340.0070.00314.24
5.6.330.0090.00614.22
5.6.320.0120.00014.52
5.6.310.0070.00714.22
5.6.300.0030.01014.69
5.6.290.0090.00614.49
5.6.280.0050.03817.58
5.6.270.0050.00514.54
5.6.260.0090.00614.57
5.6.250.0030.01014.73
5.6.240.0070.00714.71
5.6.230.0030.00914.59
5.6.220.0060.00914.45
5.6.210.0050.04517.41
5.6.200.0110.03016.47
5.6.190.0100.03817.55
5.6.180.0120.02517.54
5.6.170.0100.02517.58
5.6.160.0050.04617.44
5.6.150.0040.03216.45
5.6.140.0100.04016.43
5.6.130.0070.03716.37
5.6.120.0050.04717.72
5.6.110.0050.04417.81
5.6.100.0030.04917.76
5.6.90.0020.04817.78
5.6.80.0060.04417.45
5.6.70.2260.01817.39
5.6.60.0030.01414.19
5.6.50.0100.00714.07
5.6.40.0060.00314.46
5.6.30.0060.00614.41
5.6.20.0100.00314.50
5.6.10.0090.00014.49
5.6.00.0040.00714.04
5.5.380.0060.00314.48
5.5.370.0060.00914.76
5.5.360.0000.01614.29
5.5.350.0150.02917.36
5.5.340.0040.03716.18
5.5.330.0050.03217.45
5.5.320.0200.04017.26
5.5.310.0130.02517.36
5.5.300.0030.03116.40
5.5.290.0030.03116.34
5.5.280.0070.02817.67
5.5.270.0030.03017.72
5.5.260.0150.04017.39
5.5.250.0060.04417.39
5.5.240.0170.04217.26
5.5.230.0090.00914.39
5.5.220.0060.00914.20
5.5.210.0060.00314.27
5.5.200.0040.01114.50
5.5.190.0030.01314.47
5.5.180.0000.01314.13
5.5.170.0120.00014.29
5.5.160.0030.00914.07
5.5.150.0100.00714.22
5.5.140.0000.01114.58
5.5.130.0030.00614.21
5.5.120.0060.00614.32
5.5.110.0080.00614.26
5.5.100.0060.00914.46
5.5.90.0090.00614.34
5.5.80.0100.00714.48
5.5.70.0030.01214.07
5.5.60.0060.00614.57
5.5.50.0090.00414.13
5.5.40.0140.00314.09
5.5.30.0030.00614.12
5.5.20.0080.00614.09
5.5.10.0070.00714.19
5.5.00.0030.01014.27
5.4.450.0080.02915.49
5.4.440.0500.03515.36
5.4.430.0370.03215.25
5.4.420.0380.00015.24
5.4.410.0330.00315.20
5.4.400.0330.00315.23
5.4.390.0340.00115.14
5.4.380.0320.00815.31
5.4.370.0350.00315.09
5.4.360.0320.00315.07
5.4.350.0330.00315.07
5.4.340.0050.02211.49
5.4.330.0040.00411.26
5.4.320.0060.02111.77
5.4.310.0060.02111.78
5.4.300.0030.02511.76
5.4.290.0060.02311.86
5.4.280.0050.01811.63
5.4.270.0060.01911.76
5.4.260.0100.02011.87
5.4.250.0050.02411.83
5.4.240.0050.02311.91
5.4.230.0050.02111.65
5.4.220.0060.02511.73
5.4.210.0060.02011.76
5.4.200.0060.02211.86
5.4.190.0070.02111.62
5.4.180.0050.01911.80
5.4.170.0060.02011.79
5.4.160.0060.02411.78
5.4.150.0080.02111.63
5.4.140.0080.02511.52
5.4.130.0020.02511.63
5.4.120.0060.02311.71
5.4.110.0030.02811.65
5.4.100.0020.02411.53
5.4.90.0030.02511.45
5.4.80.0060.02011.65
5.4.70.0060.02411.64
5.4.60.0020.02211.63
5.4.50.0070.02111.68
5.4.40.0050.02311.56
5.4.30.0030.02311.54
5.4.20.0040.02311.59
5.4.10.0030.02411.55
5.4.00.0050.01911.18
5.3.290.0070.04012.80
5.3.280.0110.03412.71
5.3.270.0090.03712.72
5.3.260.0050.04412.72
5.3.250.0030.04012.72
5.3.240.0070.03712.72
5.3.230.0090.03412.71
5.3.220.0050.03712.68
5.3.210.0080.04112.68
5.3.200.0090.04012.68
5.3.190.0060.04212.68
5.3.180.0070.04712.67
5.3.170.0090.04212.67
5.3.160.0090.03412.67
5.3.150.0060.03912.67
5.3.140.0070.03612.66
5.3.130.0100.04112.66
5.3.120.0060.03912.66
5.3.110.0080.03812.66
5.3.100.0090.03612.14
5.3.90.0060.03812.12
5.3.80.0070.03512.10
5.3.70.0080.03512.11
5.3.60.0040.04512.09
5.3.50.0100.03912.04
5.3.40.0090.03512.04
5.3.30.0080.03612.00
5.3.20.0060.03511.78
5.3.10.0090.03911.75
5.3.00.0080.03911.73
5.2.170.0050.0319.24
5.2.160.0060.0279.23
5.2.150.0050.0399.24
5.2.140.0050.0299.23
5.2.130.0060.0369.19
5.2.120.0060.0329.19
5.2.110.0050.0319.20
5.2.100.0040.0289.19
5.2.90.0080.0259.19
5.2.80.0060.0339.19
5.2.70.0100.0279.19
5.2.60.0080.0279.15
5.2.50.0090.0329.11
5.2.40.0070.0269.09
5.2.30.0070.0289.06
5.2.20.0050.0299.05
5.2.10.0030.0308.96
5.2.00.0080.0288.83
5.1.60.0060.0228.11
5.1.50.0040.0258.11
5.1.40.0050.0248.09
5.1.30.0060.0258.43
5.1.20.0020.0288.46
5.1.10.0060.0298.19
5.1.00.0060.0238.18
5.0.50.0040.0206.66
5.0.40.0030.0206.53
5.0.30.0060.0296.34
5.0.20.0090.0136.30
5.0.10.0040.0196.28
5.0.00.0050.0296.28
4.4.90.0040.0144.78
4.4.80.0040.0134.76
4.4.70.0040.0144.75
4.4.60.0060.0124.75
4.4.50.0030.0154.77
4.4.40.0030.0244.71
4.4.30.0060.0164.76
4.4.20.0040.0154.84
4.4.10.0040.0144.85
4.4.00.0020.0254.75
4.3.110.0010.0174.67
4.3.100.0050.0124.66
4.3.90.0050.0124.63
4.3.80.0030.0244.58
4.3.70.0020.0154.63
4.3.60.0030.0144.63
4.3.50.0050.0134.63
4.3.40.0040.0224.54
4.3.30.0020.0203.30
4.3.20.0000.0243.28
4.3.10.0030.0143.23
4.3.00.0130.0236.63

preferences:
54.98 ms | 401 KiB | 5 Q