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.0060.00918.43
8.3.50.0130.00522.05
8.3.40.0070.00718.97
8.3.30.0100.00320.34
8.3.20.0050.00320.29
8.3.10.0040.00421.97
8.3.00.0120.00322.39
8.2.180.0150.00016.75
8.2.170.0090.00622.96
8.2.160.0040.01122.07
8.2.150.0090.00024.18
8.2.140.0080.00024.66
8.2.130.0050.00326.16
8.2.120.0090.00019.77
8.2.110.0030.00622.26
8.2.100.0090.00318.03
8.2.90.0030.00617.97
8.2.80.0000.00917.97
8.2.70.0040.00417.75
8.2.60.0000.01118.04
8.2.50.0060.00618.07
8.2.40.0030.00618.16
8.2.30.0030.00718.11
8.2.20.0040.00417.67
8.2.10.0000.00717.88
8.2.00.0030.00817.68
8.1.280.0150.00325.92
8.1.270.0020.00524.66
8.1.260.0000.00826.35
8.1.250.0000.00728.09
8.1.240.0090.00022.50
8.1.230.0080.00320.95
8.1.220.0040.00417.74
8.1.210.0030.00518.98
8.1.200.0050.00517.35
8.1.190.0040.00417.63
8.1.180.0060.00618.10
8.1.170.0030.00518.32
8.1.160.0040.00420.88
8.1.150.0040.00418.55
8.1.140.0040.00417.39
8.1.130.0070.00017.69
8.1.120.0030.00517.49
8.1.110.0040.00417.45
8.1.100.0000.00717.45
8.1.90.0030.00417.36
8.1.80.0040.00417.48
8.1.70.0000.00717.46
8.1.60.0060.00317.54
8.1.50.0000.00717.51
8.1.40.0000.00817.45
8.1.30.0050.00317.53
8.1.20.0000.00817.55
8.1.10.0000.00717.57
8.1.00.0000.01017.52
8.0.300.0040.00420.04
8.0.290.0070.00017.04
8.0.280.0030.00318.50
8.0.270.0070.00017.14
8.0.260.0030.00316.92
8.0.250.0030.00316.98
8.0.240.0070.00017.04
8.0.230.0000.00716.95
8.0.220.0030.00516.87
8.0.210.0030.00316.93
8.0.200.0000.00717.07
8.0.190.0070.00317.03
8.0.180.0040.00416.88
8.0.170.0080.00017.00
8.0.160.0000.00717.07
8.0.150.0030.00516.79
8.0.140.0040.00416.93
8.0.130.0000.00513.45
8.0.120.0050.00316.83
8.0.110.0040.00416.96
8.0.100.0040.00416.76
8.0.90.0050.00216.85
8.0.80.0160.00616.93
8.0.70.0080.00016.84
8.0.60.0050.00316.83
8.0.50.0040.00416.75
8.0.30.0070.01017.24
8.0.20.0030.01417.40
8.0.10.0060.00317.01
8.0.00.0140.00416.61
7.4.330.0060.00015.00
7.4.320.0030.00316.55
7.4.300.0000.00616.67
7.4.290.0030.00316.59
7.4.280.0040.00416.52
7.4.270.0000.00716.61
7.4.260.0000.00513.29
7.4.250.0030.00516.55
7.4.240.0030.00316.53
7.4.230.0000.00716.39
7.4.220.0070.01116.63
7.4.210.0070.00716.59
7.4.200.0030.00316.71
7.4.190.0040.00416.48
7.4.160.0100.00616.54
7.4.150.0110.00717.40
7.4.140.0130.01617.86
7.4.130.0080.00916.79
7.4.120.0050.01216.65
7.4.110.0100.00716.61
7.4.100.0150.00616.39
7.4.90.0030.01516.43
7.4.80.0070.01619.39
7.4.70.0030.01216.63
7.4.60.0090.01316.37
7.4.50.0030.00616.40
7.4.40.0060.01022.77
7.4.30.0100.01016.30
7.4.00.0030.01114.86
7.3.330.0000.00513.38
7.3.320.0030.00313.38
7.3.310.0000.00716.34
7.3.300.0000.00716.46
7.3.290.0060.00816.45
7.3.280.0060.01016.40
7.3.270.0040.01517.40
7.3.260.0070.01016.43
7.3.250.0080.00916.39
7.3.240.0030.01316.60
7.3.230.0170.00316.62
7.3.210.0150.00616.48
7.3.200.0130.01019.39
7.3.190.0120.00616.40
7.3.180.0080.00816.46
7.3.170.0080.00816.48
7.3.160.0100.00716.51
7.3.120.0120.00314.81
7.2.330.0060.01216.76
7.2.320.0110.00616.67
7.2.310.0130.00716.60
7.2.300.0080.00816.84
7.2.290.0030.01316.72
7.2.00.0030.00919.49
7.1.100.0080.00517.90
7.1.70.0030.00617.02
7.1.60.0090.00919.43
7.1.50.0070.01517.11
7.1.00.0000.04022.40
7.0.200.0000.00916.73
7.0.140.0100.06722.07
7.0.60.0200.07320.02
7.0.50.0070.08017.87
7.0.40.0100.08020.52
7.0.30.0170.04320.17
7.0.20.0230.06320.23
7.0.10.0130.04720.21
7.0.00.0000.04320.05
5.6.280.0030.07321.09
5.6.210.0070.08720.61
5.6.200.0030.05018.20
5.6.190.0070.04020.47
5.6.180.0300.04020.49
5.6.170.0270.05020.51
5.6.160.0100.08020.57
5.6.150.0070.08318.25
5.6.140.0070.03718.24
5.6.130.0070.08018.17
5.6.120.0030.08321.13
5.6.110.0070.08321.12
5.6.100.0100.04721.02
5.6.90.0170.07020.98
5.6.80.0170.07720.36
5.6.70.3330.03020.48
5.5.350.0170.06720.38
5.5.340.0100.06718.02
5.5.330.0100.07720.13
5.5.320.0070.08320.42
5.5.310.0170.04320.34
5.5.300.0030.08018.08
5.5.290.0030.04317.98
5.5.280.0100.07320.86
5.5.270.0100.06720.68
5.5.260.0100.03320.97
5.5.250.0070.06020.60
5.5.240.0270.07720.13
5.4.450.0170.06019.38
5.4.440.1070.06319.48
5.4.430.0800.05019.34
5.4.420.1170.06019.47
5.4.410.0930.05719.18
5.4.400.0370.05018.75
5.4.390.0300.05718.79
5.4.380.0300.05018.57
5.4.370.0300.05718.80
5.4.360.0270.04718.84
5.4.350.0110.03712.03
5.4.340.0090.04012.02
5.4.320.0030.04712.51
5.4.310.0080.03912.51
5.4.300.0050.03712.52
5.4.290.0040.04012.51
5.4.280.0060.03612.40
5.4.270.0060.04612.41
5.4.260.0070.03912.40
5.4.250.0090.04112.41
5.4.240.0070.05718.73
5.4.230.0130.05019.00
5.4.220.0070.05318.95
5.4.210.0170.05318.89
5.4.200.0130.05318.72
5.4.190.0100.06018.64
5.4.180.0100.05718.80
5.4.170.0030.05319.02
5.4.160.0170.06018.93
5.4.150.0030.07718.93
5.4.140.0100.06716.56
5.4.130.0070.06016.58
5.4.120.0230.06716.54
5.4.110.0030.05316.57
5.4.100.0100.06316.40
5.4.90.0230.05016.48
5.4.80.0070.05016.41
5.4.70.0130.04316.52
5.4.60.0070.05316.46
5.4.50.0230.05316.54
5.4.40.0030.07316.68
5.4.30.0130.05016.62
5.4.20.0130.06716.33
5.4.10.0070.05716.47
5.4.00.0170.06716.04
5.3.290.0100.04212.80
5.3.280.0030.05314.51
5.3.270.0000.06314.71
5.3.260.0030.06014.84
5.3.250.0070.05314.69
5.3.240.0030.06014.80
5.3.230.0100.05714.69
5.3.220.0130.04714.42
5.3.210.0170.05014.74
5.3.200.0100.05314.75
5.3.190.0070.06314.74
5.3.180.0100.05314.41
5.3.170.0100.05714.71
5.3.160.0100.05014.57
5.3.150.0100.05714.41
5.3.140.0030.05714.73
5.3.130.0170.05714.65
5.3.120.0030.05714.39
5.3.110.0100.07314.58
5.3.100.0030.05714.14
5.3.90.0200.05714.12
5.3.80.0070.05014.20
5.3.70.0070.05014.20
5.3.60.0130.05013.92
5.3.50.0030.07313.93
5.3.40.0100.05014.04
5.3.30.0130.05714.10
5.3.20.0030.06013.78
5.3.10.0130.04313.66
5.3.00.0130.04313.83
5.2.170.0070.04711.25
5.2.160.0030.04311.21
5.2.150.0100.04011.38
5.2.140.0130.03711.23
5.2.130.0030.06310.95
5.2.120.0100.04711.10
5.2.110.0100.03711.28
5.2.100.0100.03711.11
5.2.90.0000.04311.22
5.2.80.0100.04010.94
5.2.70.0070.04311.19
5.2.60.0030.04711.24
5.2.50.0170.04711.26
5.2.40.0070.05311.24
5.2.30.0170.03310.94
5.2.20.0130.03711.13
5.2.10.0100.03311.05
5.2.00.0100.03710.80
5.1.60.0070.0379.99
5.1.50.0100.0309.98
5.1.40.0030.0409.95
5.1.30.0030.04010.18
5.1.20.0100.03310.45
5.1.10.0130.03710.28
5.1.00.0070.03310.18
5.0.50.0030.0308.40
5.0.40.0030.0278.35
5.0.30.0000.0438.22
5.0.20.0070.0338.27
5.0.10.0170.0138.28
5.0.00.0000.0438.22
4.4.90.0030.0207.30
4.4.80.0030.0277.30
4.4.70.0030.0207.30
4.4.60.0030.0207.30
4.4.50.0070.0277.30
4.4.40.0030.0337.30
4.4.30.0070.0237.30
4.4.20.0070.0207.30
4.4.10.0000.0237.30
4.4.00.0100.0277.30
4.3.110.0000.0277.30
4.3.100.0030.0207.30
4.3.90.0030.0237.30
4.3.80.0030.0337.30
4.3.70.0030.0207.30
4.3.60.0070.0177.30
4.3.50.0000.0307.30
4.3.40.0000.0377.30
4.3.30.0030.0277.30
4.3.20.0000.0307.30
4.3.10.0030.0207.30
4.3.00.0070.0207.00

preferences:
55.79 ms | 401 KiB | 5 Q