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(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.0040.01118.68
8.3.50.0100.00718.30
8.3.40.0120.00618.91
8.3.30.0090.00619.17
8.3.20.0000.00820.38
8.3.10.0040.00423.67
8.3.00.0030.00619.63
8.2.180.0100.00716.49
8.2.170.0060.00919.21
8.2.160.0070.00722.96
8.2.150.0050.00325.66
8.2.140.0050.00324.66
8.2.130.0000.00826.16
8.2.120.0080.00022.35
8.2.110.0120.00422.11
8.2.100.0030.00917.88
8.2.90.0040.00419.30
8.2.80.0040.00417.97
8.2.70.0060.00317.88
8.2.60.0080.00018.04
8.2.50.0050.00318.07
8.2.40.0000.00818.22
8.2.30.0040.00418.19
8.2.20.0060.00317.88
8.2.10.0040.00418.10
8.2.00.0050.00517.88
8.1.280.0070.00725.92
8.1.270.0060.00923.84
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0140.00323.92
8.1.230.0110.00019.20
8.1.220.0000.00817.74
8.1.210.0040.00418.77
8.1.200.0040.00817.60
8.1.190.0030.00617.48
8.1.180.0030.00518.10
8.1.170.0100.00018.83
8.1.160.0040.00422.04
8.1.150.0040.00418.95
8.1.140.0000.00717.52
8.1.130.0000.00817.80
8.1.120.0000.00717.52
8.1.110.0090.00017.53
8.1.100.0050.00217.65
8.1.90.0000.00817.71
8.1.80.0050.00217.70
8.1.70.0000.00717.60
8.1.60.0030.00617.67
8.1.50.0030.00517.64
8.1.40.0050.00317.71
8.1.30.0030.00617.95
8.1.20.0020.00517.86
8.1.10.0090.00017.77
8.1.00.0040.00417.66
8.0.300.0040.00418.77
8.0.290.0000.00817.00
8.0.280.0040.00418.51
8.0.270.0030.00317.24
8.0.260.0000.00617.29
8.0.250.0040.00317.21
8.0.240.0000.00917.25
8.0.230.0000.00917.18
8.0.220.0070.00017.21
8.0.210.0030.00317.03
8.0.200.0000.00717.12
8.0.190.0030.00617.09
8.0.180.0040.00417.09
8.0.170.0000.00817.06
8.0.160.0070.00017.14
8.0.150.0030.00517.11
8.0.140.0050.00317.12
8.0.130.0030.00313.63
8.0.120.0040.00417.02
8.0.110.0020.00517.13
8.0.100.0070.00017.18
8.0.90.0000.00717.26
8.0.80.0070.01117.15
8.0.70.0040.00417.17
8.0.60.0040.00417.01
8.0.50.0040.00417.21
8.0.30.0120.00717.57
8.0.20.0100.00817.48
8.0.10.0000.00717.07
8.0.00.0100.00817.16
7.4.330.0000.00515.02
7.4.320.0030.00316.75
7.4.300.0000.00616.90
7.4.290.0040.00416.69
7.4.280.0070.00416.71
7.4.270.0070.00016.83
7.4.260.0030.00316.77
7.4.250.0000.00716.63
7.4.240.0050.00216.71
7.4.230.0030.00316.84
7.4.220.0070.01116.97
7.4.210.0110.00416.88
7.4.200.0080.00016.75
7.4.160.0110.00416.86
7.4.150.0080.01117.40
7.4.140.0090.01217.86
7.4.130.0110.00616.70
7.4.120.0070.01416.67
7.4.110.0090.01216.83
7.4.100.0180.00516.91
7.4.90.0040.01416.83
7.4.80.0090.00919.39
7.4.70.0130.01016.93
7.4.60.0050.01116.85
7.4.50.0000.00816.58
7.4.40.0110.00616.64
7.4.30.0120.00616.75
7.4.10.0070.00715.16
7.4.00.0100.00715.14
7.3.330.0000.00613.30
7.3.320.0000.00513.28
7.3.310.0040.00416.46
7.3.300.0000.00716.41
7.3.290.0020.01216.47
7.3.280.0080.01016.47
7.3.270.0140.00417.40
7.3.260.0030.01416.61
7.3.250.0070.01016.59
7.3.240.0040.01216.69
7.3.230.0070.01016.50
7.3.210.0120.00916.57
7.3.200.0140.00419.39
7.3.190.0150.00616.49
7.3.180.0100.00716.93
7.3.170.0060.01016.61
7.3.160.0160.00016.91
7.3.130.0090.00914.89
7.3.120.0050.01215.14
7.3.110.0070.00714.94
7.3.100.0020.01115.04
7.3.90.0030.01114.92
7.3.80.0040.01114.66
7.3.70.0090.00515.01
7.3.60.0040.01015.00
7.3.50.0050.01114.98
7.3.40.0120.00014.85
7.3.30.0050.01115.01
7.3.20.0090.00416.97
7.3.10.0070.00616.85
7.3.00.0050.00616.77
7.2.330.0120.00616.67
7.2.320.0060.01117.01
7.2.310.0060.01316.83
7.2.300.0120.00616.85
7.2.290.0100.01016.86
7.2.260.0090.00915.33
7.2.250.0040.01515.39
7.2.240.0080.00815.18
7.2.230.0040.01115.42
7.2.220.0020.01115.35
7.2.210.0030.01115.25
7.2.200.0000.01115.24
7.2.190.0060.00715.17
7.2.180.0090.00815.29
7.2.170.0090.00515.24
7.2.160.0050.00815.24
7.2.150.0070.00817.26
7.2.140.0050.00817.05
7.2.130.0060.00817.18
7.2.120.0070.00717.16
7.2.110.0040.00917.06
7.2.100.0080.00717.11
7.2.90.0060.00817.13
7.2.80.0050.01017.10
7.2.70.0090.00617.18
7.2.60.0070.00317.18
7.2.50.0070.00917.26
7.2.40.0050.00817.09
7.2.30.0060.00717.13
7.2.20.0070.00717.15
7.2.10.0050.00917.18
7.2.00.0070.01017.60
7.1.330.0070.00516.04
7.1.320.0020.01016.03
7.1.310.0060.00515.94
7.1.300.0040.01116.02
7.1.290.0040.00616.04
7.1.280.0060.00816.07
7.1.270.0030.01015.94
7.1.260.0040.00815.95
7.1.250.0080.00415.93
7.1.240.0030.00916.04
7.1.230.0070.00716.00
7.1.220.0070.00415.74
7.1.210.0110.00315.91
7.1.200.0070.00316.08
7.1.190.0070.00715.95
7.1.180.0030.01016.17
7.1.170.0060.00615.94
7.1.160.0060.00315.89
7.1.150.0070.00715.96
7.1.140.0040.00716.16
7.1.130.0070.00716.03
7.1.120.0130.00016.08
7.1.110.0030.00916.05
7.1.100.0040.00817.27
7.1.90.0090.00316.02
7.1.80.0070.00716.07
7.1.70.0120.00116.70
7.1.60.0080.01017.41
7.1.50.0080.01116.63
7.1.40.0090.00615.99
7.1.30.0040.01215.96
7.1.20.0040.01115.88
7.1.10.0090.00316.01
7.1.00.0040.04419.23
7.0.330.0060.00315.73
7.0.320.0000.01115.43
7.0.310.0080.00615.65
7.0.300.0070.00715.50
7.0.290.0090.00615.63
7.0.280.0090.00315.74
7.0.270.0030.00515.82
7.0.260.0090.00915.63
7.0.250.0030.00715.41
7.0.240.0100.00315.66
7.0.230.0070.00415.66
7.0.220.0030.01015.78
7.0.210.0030.01015.35
7.0.200.0020.00916.29
7.0.190.0040.00915.79
7.0.180.0030.00915.56
7.0.170.0070.00315.73
7.0.160.0070.01015.69
7.0.150.0030.01015.23
7.0.140.0050.03818.77
7.0.130.0030.01015.65
7.0.120.0060.00615.68
7.0.110.0090.00615.60
7.0.100.0040.01115.53
7.0.90.0100.00315.72
7.0.80.0000.00815.69
7.0.70.0000.01515.77
7.0.60.0110.03517.73
7.0.50.0050.03616.84
7.0.40.0080.02316.98
7.0.30.0370.03016.90
7.0.20.0120.02116.94
7.0.10.0080.05116.85
7.0.00.0020.04516.96
5.6.400.0090.00014.52
5.6.390.0060.00614.86
5.6.380.0090.00314.75
5.6.370.0070.00714.43
5.6.360.0000.01414.71
5.6.350.0080.00314.38
5.6.340.0090.00614.67
5.6.330.0030.00714.61
5.6.320.0080.00414.85
5.6.310.0030.01214.52
5.6.300.0040.01114.13
5.6.290.0030.01014.44
5.6.280.0020.04317.77
5.6.270.0030.01014.63
5.6.260.0060.00914.39
5.6.250.0090.00014.29
5.6.240.0000.01214.30
5.6.230.0000.01114.24
5.6.220.0030.01114.67
5.6.210.0030.03917.39
5.6.200.0080.02816.29
5.6.190.0060.04617.41
5.6.180.0170.03317.58
5.6.170.0080.02817.45
5.6.160.0100.04417.55
5.6.150.0030.03916.38
5.6.140.0050.04016.34
5.6.130.0030.04116.30
5.6.120.0080.04717.93
5.6.110.0150.03517.86
5.6.100.0100.04517.89
5.6.90.0110.04117.63
5.6.80.0090.03617.32
5.6.70.2010.02217.33
5.6.60.0030.01014.31
5.6.50.0000.01414.36
5.6.40.0030.01014.45
5.6.30.0030.00914.48
5.6.20.0070.00714.50
5.6.10.0000.01314.29
5.6.00.0070.01014.13
5.5.380.0000.01414.37
5.5.370.0120.00414.47
5.5.360.0060.00614.36
5.5.350.0120.02217.48
5.5.340.0100.04316.23
5.5.330.0060.02317.46
5.5.320.0200.04517.44
5.5.310.0180.04317.30
5.5.300.0100.03716.17
5.5.290.0100.04016.16
5.5.280.0060.03617.52
5.5.270.0070.02717.53
5.5.260.0080.04317.67
5.5.250.0050.03717.53
5.5.240.0140.04117.37
5.5.230.0090.00314.38
5.5.220.0070.00714.00
5.5.210.0030.01014.34
5.5.200.0000.01314.23
5.5.190.0080.00614.35
5.5.180.0080.00514.43
5.5.170.0060.00814.28
5.5.160.0030.00914.37
5.5.150.0060.00614.36
5.5.140.0040.01114.25
5.5.130.0080.00414.31
5.5.120.0100.00314.41
5.5.110.0080.00814.23
5.5.100.0130.00014.23
5.5.90.0080.01114.46
5.5.80.0100.00014.18
5.5.70.0120.00414.45
5.5.60.0030.01014.31
5.5.50.0000.01514.39
5.5.40.0070.01014.14
5.5.30.0040.01114.30
5.5.20.0070.00414.34
5.5.10.0090.00314.22
5.5.00.0030.01214.22
5.4.450.0300.03815.41
5.4.440.0410.03015.51
5.4.430.0050.03415.25
5.4.420.0360.00315.16
5.4.410.0350.00215.07
5.4.400.0400.00615.12
5.4.390.0320.00315.11
5.4.380.0330.00414.94
5.4.370.0370.00315.04
5.4.360.0360.00215.06
5.4.350.0370.00215.12
5.4.340.0060.02111.49
5.4.330.0030.00510.83
5.4.320.0060.01911.92
5.4.310.0070.02111.72
5.4.300.0040.02511.62
5.4.290.0060.02111.80
5.4.280.0050.02211.71
5.4.270.0030.02311.67
5.4.260.0040.02711.71
5.4.250.0070.02311.89
5.4.240.0040.02211.71
5.4.230.0080.01911.72
5.4.220.0050.02111.66
5.4.210.0070.02211.59
5.4.200.0080.02111.66
5.4.190.0050.02311.82
5.4.180.0050.02411.67
5.4.170.0040.02211.54
5.4.160.0040.02311.71
5.4.150.0050.02211.72
5.4.140.0090.02511.66
5.4.130.0070.01911.57
5.4.120.0060.02111.44
5.4.110.0030.02411.63
5.4.100.0040.02311.61
5.4.90.0070.01911.52
5.4.80.0040.02111.66
5.4.70.0050.02211.61
5.4.60.0060.02311.53
5.4.50.0030.02411.60
5.4.40.0050.02011.61
5.4.30.0060.02211.43
5.4.20.0070.02211.65
5.4.10.0040.02511.46
5.4.00.0060.02511.21
5.3.290.0040.04112.80
5.3.280.0100.03512.71
5.3.270.0060.04112.72
5.3.260.0090.04212.72
5.3.250.0080.03612.72
5.3.240.0050.03812.72
5.3.230.0100.03412.70
5.3.220.0100.03412.68
5.3.210.0080.03712.68
5.3.200.0090.03412.68
5.3.190.0090.03912.68
5.3.180.0090.03612.67
5.3.170.0060.03612.67
5.3.160.0080.04012.67
5.3.150.0070.03612.67
5.3.140.0060.03612.66
5.3.130.0100.03512.66
5.3.120.0060.04012.65
5.3.110.0100.03612.66
5.3.100.0060.04412.13
5.3.90.0090.03512.12
5.3.80.0080.03612.11
5.3.70.0060.03712.10
5.3.60.0050.03712.09
5.3.50.0080.03412.04
5.3.40.0040.03812.04
5.3.30.0050.03612.00
5.3.20.0070.03511.78
5.3.10.0050.03711.75
5.3.00.0070.03611.73
5.2.170.0060.0319.23
5.2.160.0060.0289.23
5.2.150.0050.0319.24
5.2.140.0050.0319.23
5.2.130.0070.0319.20
5.2.120.0060.0329.19
5.2.110.0050.0289.20
5.2.100.0080.0249.20
5.2.90.0020.0319.19
5.2.80.0060.0299.19
5.2.70.0060.0299.19
5.2.60.0070.0329.15
5.2.50.0060.0309.12
5.2.40.0080.0319.10
5.2.30.0070.0279.07
5.2.20.0040.0339.06
5.2.10.0060.0318.96
5.2.00.0070.0318.82
5.1.60.0030.0258.11
5.1.50.0110.0188.11
5.1.40.0030.0258.09
5.1.30.0040.0268.44
5.1.20.0030.0288.46
5.1.10.0050.0288.19
5.1.00.0050.0308.19
5.0.50.0060.0226.66
5.0.40.0040.0196.53
5.0.30.0040.0306.33
5.0.20.0030.0276.30
5.0.10.0080.0196.29
5.0.00.0020.0486.27
4.4.90.0040.0174.78
4.4.80.0040.0154.76
4.4.70.0030.0194.76
4.4.60.0050.0134.75
4.4.50.0030.0194.77
4.4.40.0050.0264.71
4.4.30.0030.0184.76
4.4.20.0050.0194.84
4.4.10.0010.0174.84
4.4.00.0010.0264.76
4.3.110.0030.0244.67
4.3.100.0060.0234.66
4.3.90.0050.0174.63
4.3.80.0050.0234.58
4.3.70.0050.0124.63
4.3.60.0060.0144.63
4.3.50.0090.0164.62
4.3.40.0030.0254.54
4.3.30.0020.0173.30
4.3.20.0040.0163.28
4.3.10.0010.0183.23
4.3.00.0130.0206.63

preferences:
46.3 ms | 400 KiB | 5 Q