3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Tag { private $name; private $attrs = array(); private $content = null; function __construct($name) { $this->name = $name; } function __toString() { $code = "<" . $this->name; foreach($this->attrs as $name => $val) { $code .= " " . $name . "=\"$val\""; } $code .= ">" . (!is_null($this->content) ? $this->content : '') . "</" . $this->name. ">"; return $code; } function addClass($className) { $this->attrs["class"] .= $className." "; return $this; } function addTitle($title) { $this->attrs["title"] = $title; return $this; } function addContent($content) { $this->content = $content; return $this; } function stringify() { return $this; } } $paragraph = new Tag('p'); echo $paragraph ->addClass("test") ->addTitle("Kubo2's testing paragraph") ->addContent("This is Kubo2's testing paragraph. It relates to http://djpw.cz/154725") ->stringify();

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.56
8.3.50.0090.00821.96
8.3.40.0140.00718.79
8.3.30.0060.00920.41
8.3.20.0080.00020.20
8.3.10.0080.00022.01
8.3.00.0070.00722.58
8.2.180.0000.01516.50
8.2.170.0060.00922.96
8.2.160.0160.00022.13
8.2.150.0080.00024.18
8.2.140.0000.00824.66
8.2.130.0030.00526.16
8.2.120.0080.00019.79
8.2.110.0030.00622.05
8.2.100.0040.00719.25
8.2.90.0040.00419.35
8.2.80.0070.00019.40
8.2.70.0000.00817.75
8.2.60.0000.00917.93
8.2.50.0090.00318.07
8.2.40.0040.00418.34
8.2.30.0050.00518.20
8.2.20.0000.00717.67
8.2.10.0000.00717.82
8.2.00.0070.00417.84
8.1.280.0140.00325.92
8.1.270.0060.00324.66
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0060.00322.18
8.1.230.0070.00319.15
8.1.220.0100.00517.74
8.1.210.0040.00418.77
8.1.200.0030.00717.35
8.1.190.0040.00417.51
8.1.180.0000.00919.14
8.1.170.0000.00818.45
8.1.160.0040.00420.95
8.1.150.0040.00418.75
8.1.140.0000.00717.48
8.1.130.0030.00317.75
8.1.120.0070.00017.48
8.1.110.0050.00317.45
8.1.100.0040.00417.46
8.1.90.0040.00417.49
8.1.80.0040.00417.48
8.1.70.0050.00317.43
8.1.60.0000.00817.50
8.1.50.0000.00717.49
8.1.40.0050.00317.55
8.1.30.0080.00017.59
8.1.20.0000.00817.68
8.1.10.0040.00417.68
8.1.00.0090.00417.53
8.0.300.0070.00018.77
8.0.290.0000.00717.17
8.0.280.0030.00518.42
8.0.270.0000.00717.31
8.0.260.0060.00016.89
8.0.250.0070.00017.04
8.0.240.0000.00817.02
8.0.230.0070.00016.91
8.0.220.0000.01016.87
8.0.210.0000.00716.86
8.0.200.0030.00317.04
8.0.190.0040.00716.80
8.0.180.0040.00416.89
8.0.170.0000.00816.88
8.0.160.0070.00017.01
8.0.150.0070.00016.96
8.0.140.0000.00716.81
8.0.130.0030.00313.43
8.0.120.0080.00016.96
8.0.110.0040.00416.84
8.0.100.0040.00417.08
8.0.90.0070.00016.92
8.0.80.0090.00916.92
8.0.70.0030.00516.91
8.0.60.0070.00017.08
8.0.50.0000.00716.98
8.0.30.0080.01117.36
8.0.20.0160.00617.40
8.0.10.0040.00416.95
8.0.00.0100.01016.89
7.4.330.0000.00515.20
7.4.320.0040.00416.52
7.4.300.0000.00616.54
7.4.290.0000.00616.62
7.4.280.0030.00316.54
7.4.270.0000.00816.52
7.4.260.0000.00613.16
7.4.250.0050.00316.46
7.4.240.0020.00516.59
7.4.230.0030.00316.50
7.4.220.0070.01116.48
7.4.210.0080.00716.57
7.4.200.0070.00016.59
7.4.190.0030.00316.47
7.4.160.0090.00616.43
7.4.150.0130.01017.40
7.4.140.0230.01617.86
7.4.130.0090.01216.53
7.4.120.0100.00816.56
7.4.110.0110.00616.58
7.4.100.0140.00716.52
7.4.90.0090.00916.69
7.4.80.0150.00619.39
7.4.70.0030.01416.60
7.4.60.0090.01216.36
7.4.50.0080.00016.35
7.4.40.0130.00022.77
7.4.30.0070.01416.52
7.4.00.0070.01015.16
7.3.330.0000.00513.32
7.3.320.0060.00013.51
7.3.310.0070.00016.42
7.3.300.0070.00016.41
7.3.290.0060.00916.33
7.3.280.0100.00716.45
7.3.270.0110.00717.40
7.3.260.0060.01316.42
7.3.250.0120.00716.51
7.3.240.0090.00916.46
7.3.230.0130.00716.39
7.3.210.0080.00816.59
7.3.200.0130.01019.39
7.3.190.0090.00916.60
7.3.180.0090.00916.35
7.3.170.0080.00816.41
7.3.160.0090.00616.28
7.3.120.0070.00715.12
7.2.330.0140.00316.78
7.2.320.0090.01416.53
7.2.310.0070.01016.55
7.2.300.0130.00316.41
7.2.290.0100.00716.59
7.2.60.0060.00617.05
7.2.00.0040.00719.47
7.1.200.0030.00315.68
7.1.100.0000.01318.00
7.1.70.0000.00717.34
7.1.60.0060.01819.43
7.1.50.0030.01516.94
7.1.00.0030.03322.45
7.0.200.0030.00616.74
7.0.140.0030.07322.09
7.0.110.0070.08321.68
7.0.100.0100.06321.70
7.0.90.0070.07021.64
7.0.80.0000.08021.81
7.0.70.0170.06721.82
7.0.60.0100.07321.68
7.0.50.0000.08021.92
7.0.40.0000.09020.11
7.0.30.0000.08319.98
7.0.20.0070.08020.16
7.0.10.0000.05720.02
7.0.00.0030.08720.17
5.6.280.0030.07320.92
5.6.260.0000.04320.57
5.6.250.0100.08020.64
5.6.240.0030.05320.51
5.6.230.0000.07320.50
5.6.220.0100.04320.50
5.6.210.0000.07320.51
5.6.200.0070.08020.95
5.6.190.0070.04720.95
5.6.180.0070.08021.02
5.6.170.0000.08321.20
5.6.160.0070.06321.15
5.6.150.0000.06721.10
5.6.140.0030.08721.05
5.6.130.0030.08021.14
5.6.120.0000.05721.15
5.6.110.0000.04321.24
5.6.100.0070.03721.08
5.6.90.0000.04320.87
5.6.80.0000.04020.27
5.6.70.0000.04020.29
5.6.60.0000.03720.48
5.6.50.0000.05020.30
5.6.40.0130.07320.26
5.6.30.0000.03720.53
5.6.20.0070.07720.43
5.6.10.0130.06020.60
5.6.00.0000.08020.39
5.5.380.0100.07720.21
5.5.370.0100.07320.37
5.5.360.0070.07720.24
5.5.350.0000.05320.46
5.5.340.0030.08320.95
5.5.330.0030.08720.84
5.5.320.0100.07720.80
5.5.310.0000.08320.86
5.5.300.0100.07720.66
5.5.290.0030.05020.98
5.5.280.0070.08320.82
5.5.270.0070.05720.97
5.5.260.0000.05320.73
5.5.250.0070.04320.68
5.5.240.0000.04020.30
5.5.230.0000.04020.24
5.5.220.0000.04020.37
5.5.210.0070.03320.32
5.5.200.0130.06020.05
5.5.190.0000.03720.30
5.5.180.0030.04320.35
5.5.160.0000.05020.33
5.5.150.0070.03720.28
5.5.140.0100.03020.01
5.5.130.0000.05020.11
5.5.120.0030.03720.21
5.5.110.0000.04020.29
5.5.100.0000.04020.12
5.5.90.0030.03720.10
5.5.80.0000.06020.01
5.5.70.0000.04020.03
5.5.60.0030.03720.02
5.5.50.0030.03720.03
5.5.40.0070.03020.14
5.5.30.0000.04020.15
5.5.20.0000.04020.17
5.5.10.0000.04019.92
5.5.00.0030.03719.97
5.4.450.0100.04319.31
5.4.440.0070.07719.64
5.4.430.0030.04019.33
5.4.420.0030.03719.56
5.4.410.0000.04319.34
5.4.400.0000.04319.04
5.4.390.0000.04318.99
5.4.380.0000.04018.99
5.4.370.0070.04019.34
5.4.360.0000.08019.00
5.4.350.0000.07319.31
5.4.340.0030.06019.14
5.4.320.0030.04719.18
5.4.310.0030.03719.35
5.4.300.0070.03019.00
5.4.290.0030.03719.18
5.4.280.0030.03719.22
5.4.270.0000.03719.24
5.4.260.0000.03719.01
5.4.250.0030.03718.95
5.4.240.0000.03719.08
5.4.230.0030.03319.17
5.4.220.0030.05019.00
5.4.210.0070.06318.98
5.4.200.0000.03719.17
5.4.190.0070.04019.15
5.4.180.0070.03319.00
5.4.170.0000.03719.17
5.4.160.0030.03719.07
5.4.150.0030.05319.31
5.4.140.0000.04016.24
5.4.130.0000.03316.32
5.4.120.0030.03316.39
5.4.110.0000.04716.48
5.4.100.0030.04316.50
5.4.90.0030.03716.47
5.4.80.0000.03716.48
5.4.70.0030.03316.48
5.4.60.0000.03716.41
5.4.50.0030.03316.43
5.4.40.0000.07016.61
5.4.30.0030.06716.34
5.4.20.0030.06716.49
5.4.10.0070.07016.51
5.4.00.0000.07315.93
5.3.290.0030.04714.70
5.3.280.0000.03714.74
5.3.270.0000.03714.64
5.3.260.0000.03714.77
5.3.250.0000.04014.70
5.3.240.0000.03714.75
5.3.230.0000.04014.47
5.3.220.0000.03714.67
5.3.210.0000.03714.56
5.3.200.0070.03014.81
5.3.190.0000.03714.61
5.3.180.0000.03314.67
5.3.170.0000.03714.67
5.3.160.0030.04314.57
5.3.150.0000.03714.53
5.3.140.0000.03714.72
5.3.130.0030.07714.69
5.3.120.0030.06314.64
5.3.110.0070.07714.43
5.3.100.0000.04314.02
5.3.90.0000.07314.27
5.3.80.0070.05014.11
5.3.70.0000.06714.25
5.3.60.0070.07014.03
5.3.50.0030.07014.08
5.3.40.0030.07013.98
5.3.30.0030.05713.91
5.3.20.0030.07013.80
5.3.10.0030.06713.90
5.3.00.0030.06713.61
5.2.170.0070.05713.41
5.2.160.0000.07313.41
5.2.150.0000.06713.41
5.2.140.0030.06013.41
5.2.130.0030.06013.41
5.2.120.0070.05313.41
5.2.110.0000.06013.41
5.2.100.0000.06313.41
5.2.90.0030.06013.41
5.2.80.0070.06013.41
5.2.70.0000.06013.41
5.2.60.0000.06313.41
5.2.50.0000.06013.41
5.2.40.0070.05713.41
5.2.30.0030.03313.41
5.2.20.0030.04013.41
5.2.10.0000.06013.41
5.2.00.0100.05713.41
5.1.60.0030.05013.41
5.1.50.0030.04713.41
5.1.40.0030.05013.41
5.1.30.0030.05713.41
5.1.20.0030.05013.41
5.1.10.0000.04013.41
5.1.00.0070.05013.41
5.0.50.0000.04713.41
5.0.40.0030.04313.41
5.0.30.0000.06013.41
5.0.20.0000.03313.41
5.0.10.0030.04013.41
5.0.00.0030.06013.41
4.4.90.0030.03013.41
4.4.80.0030.01713.41
4.4.70.0030.03313.41
4.4.60.0030.03313.41
4.4.50.0000.03313.41
4.4.40.0000.03013.41
4.4.30.0070.02713.41
4.4.20.0000.04013.41
4.4.10.0070.03013.41
4.4.00.0070.05313.41
4.3.110.0030.03313.41
4.3.100.0000.03313.41
4.3.90.0000.02713.41
4.3.80.0000.05313.41
4.3.70.0030.03313.41
4.3.60.0000.03313.41
4.3.50.0030.03313.41
4.3.40.0000.05313.41
4.3.30.0030.03313.41
4.3.20.0030.03313.41
4.3.10.0030.03013.41
4.3.00.0000.03013.41

preferences:
44.89 ms | 401 KiB | 5 Q