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; } } //error_reporting(~E_NOTICE); $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.0110.00718.43
8.3.50.0070.01522.18
8.3.40.0130.00318.84
8.3.30.0070.00720.35
8.3.20.0070.01120.21
8.3.10.0040.00421.88
8.3.00.0040.00422.58
8.2.180.0100.00617.00
8.2.170.0100.01022.96
8.2.160.0000.01320.52
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0090.00926.16
8.2.120.0080.00019.67
8.2.110.0030.00621.98
8.2.100.0100.00517.91
8.2.90.0040.00419.22
8.2.80.0040.00419.34
8.2.70.0050.00317.75
8.2.60.0040.00418.05
8.2.50.0060.00318.07
8.2.40.0000.00918.22
8.2.30.0040.00418.13
8.2.20.0000.00817.90
8.2.10.0030.00517.69
8.2.00.0070.00717.72
8.1.280.0140.00325.92
8.1.270.0000.00724.66
8.1.260.0040.00426.35
8.1.250.0080.00328.09
8.1.240.0070.00323.65
8.1.230.0060.00618.90
8.1.220.0030.00517.74
8.1.210.0080.00018.77
8.1.200.0070.00317.22
8.1.190.0040.00417.54
8.1.180.0030.00619.07
8.1.170.0040.00418.58
8.1.160.0000.00722.25
8.1.150.0040.00418.70
8.1.140.0040.00417.36
8.1.130.0080.00017.88
8.1.120.0000.00717.48
8.1.110.0000.00717.46
8.1.100.0030.00517.46
8.1.90.0040.00317.49
8.1.80.0040.00417.35
8.1.70.0000.00717.44
8.1.60.0030.00917.41
8.1.50.0090.00017.43
8.1.40.0040.00417.41
8.1.30.0090.00017.61
8.1.20.0000.00817.66
8.1.10.0000.00817.59
8.1.00.0060.00317.51
8.0.300.0000.00718.77
8.0.290.0070.00017.16
8.0.280.0000.00718.45
8.0.270.0070.00017.32
8.0.260.0030.00316.78
8.0.250.0040.00416.92
8.0.240.0060.00617.04
8.0.230.0000.00816.93
8.0.220.0030.00617.01
8.0.210.0000.00716.96
8.0.200.0030.00317.03
8.0.190.0000.00717.03
8.0.180.0000.00816.86
8.0.170.0040.00416.87
8.0.160.0030.00316.86
8.0.150.0030.00616.79
8.0.140.0000.00716.91
8.0.130.0000.00513.35
8.0.120.0000.00716.82
8.0.110.0040.00316.92
8.0.100.0030.00616.97
8.0.90.0070.00016.90
8.0.80.0110.00417.00
8.0.70.0040.00416.99
8.0.60.0050.00217.00
8.0.50.0050.00216.99
8.0.30.0160.00817.11
8.0.20.0080.01317.41
8.0.10.0040.00417.15
8.0.00.0070.01016.80
7.4.330.0000.00515.00
7.4.320.0000.00616.66
7.4.300.0030.00316.44
7.4.290.0040.00416.46
7.4.280.0000.00716.64
7.4.270.0040.00416.59
7.4.260.0030.00616.63
7.4.250.0030.00316.55
7.4.240.0050.00216.61
7.4.230.0030.00316.41
7.4.220.0120.00616.67
7.4.210.0140.00316.48
7.4.200.0070.00016.51
7.4.190.0030.00316.69
7.4.160.0060.00916.45
7.4.150.0100.00717.40
7.4.140.0100.00817.86
7.4.130.0140.00616.54
7.4.120.0060.01116.56
7.4.110.0040.01816.62
7.4.100.0070.01416.57
7.4.90.0120.01216.71
7.4.80.0090.00619.39
7.4.70.0130.00416.39
7.4.60.0100.00616.35
7.4.50.0080.00016.50
7.4.40.0120.00322.77
7.4.30.0120.00316.56
7.4.00.0080.00815.10
7.3.330.0060.00013.37
7.3.320.0030.00213.20
7.3.310.0030.00316.21
7.3.300.0030.00316.37
7.3.290.0130.00616.45
7.3.280.0100.00516.43
7.3.270.0090.01217.40
7.3.260.0100.01016.51
7.3.250.0060.01116.44
7.3.240.0070.01016.41
7.3.230.0100.00716.62
7.3.210.0090.00916.46
7.3.200.0060.00919.39
7.3.190.0090.01316.52
7.3.180.0100.00616.43
7.3.170.0130.00316.55
7.3.160.0030.01316.49
7.3.120.0090.00714.97
7.3.110.0060.00914.74
7.3.100.0040.01214.86
7.3.90.0070.00714.80
7.3.80.0030.00814.95
7.3.70.0030.01214.85
7.3.60.0120.00514.94
7.3.50.0050.01014.74
7.3.40.0040.01014.96
7.3.30.0140.00214.92
7.3.20.0080.00716.81
7.3.10.0080.00316.61
7.3.00.0070.00816.72
7.2.330.0100.01216.84
7.2.320.0110.00816.37
7.2.310.0120.00416.48
7.2.300.0110.00716.82
7.2.290.0120.00616.51
7.2.250.0100.01015.21
7.2.240.0070.01014.88
7.2.230.0020.01215.21
7.2.220.0050.00815.19
7.2.210.0070.00715.18
7.2.200.0060.00615.07
7.2.190.0020.01115.14
7.2.180.0060.00815.15
7.2.170.0060.00914.84
7.2.160.0070.01015.32
7.2.150.0030.01216.98
7.2.140.0120.00316.89
7.2.130.0060.00916.94
7.2.120.0100.00316.80
7.2.110.0070.01116.98
7.2.100.0060.01217.09
7.2.90.0040.01116.86
7.2.80.0040.00716.98
7.2.70.0060.00917.12
7.2.60.0050.01016.89
7.2.50.0070.00516.90
7.2.40.0090.00617.10
7.2.30.0000.01717.08
7.2.20.0000.01216.76
7.2.10.0070.00716.93
7.2.00.0050.01018.29
7.1.330.0040.00915.72
7.1.320.0060.00615.76
7.1.310.0020.01115.91
7.1.300.0050.01115.80
7.1.290.0080.00715.71
7.1.280.0110.00515.79
7.1.270.0070.00515.77
7.1.260.0080.00315.90
7.1.250.0110.00415.91
7.1.200.0070.00715.90
7.1.100.0240.00718.21
7.1.70.0040.00417.19
7.1.60.0100.01419.43
7.1.50.0140.00717.11
7.1.00.0100.02722.32
7.0.200.0030.01016.44
7.0.140.0130.06722.10
7.0.60.0030.08319.87
7.0.50.0030.08317.89
7.0.40.0030.05320.04
7.0.30.0230.07720.16
7.0.20.0300.07020.33
7.0.10.0230.04020.26
7.0.00.0170.05320.32
5.6.280.0030.07321.08
5.6.210.0030.04020.70
5.6.200.0100.06318.19
5.6.190.0030.05720.46
5.6.180.0230.07020.51
5.6.170.0270.04020.62
5.6.160.0070.06020.54
5.6.150.0070.08018.29
5.6.140.0070.08018.27
5.6.130.0100.03318.18
5.6.120.0130.07021.01
5.6.110.0100.03721.15
5.6.100.0070.09021.10
5.6.90.0130.07720.89
5.6.80.0130.07720.50
5.6.70.0170.03320.38
5.5.350.0070.08020.46
5.5.340.0130.07718.00
5.5.330.0070.08720.31
5.5.320.0330.03720.34
5.5.310.0230.05720.27
5.5.300.0070.08017.97
5.5.290.0170.06017.93
5.5.280.0100.03720.89
5.5.270.0030.04320.77
5.5.260.0070.08020.78
5.5.250.0100.08320.52
5.5.240.0130.05020.14
5.4.450.0730.05719.47
5.4.440.0970.07319.63
5.4.430.0930.06319.57
5.4.420.1030.08319.58
5.4.410.1100.07319.34
5.4.400.0330.05018.82
5.4.390.0170.06018.51
5.4.380.0170.05718.60
5.4.370.0170.05018.76
5.4.360.0070.05718.76
5.4.350.0090.04212.03
5.4.340.0100.04612.02
5.4.320.0080.04112.51
5.4.310.0050.04712.51
5.4.300.0030.04212.51
5.4.290.0080.05412.51
5.4.280.0060.04212.41
5.4.270.0060.04312.41
5.4.260.0070.04412.41
5.4.250.0130.04012.41
5.4.240.0070.05319.00
5.4.230.0100.05019.00
5.4.220.0070.06318.80
5.4.210.0130.05019.00
5.4.200.0200.05318.80
5.4.190.0000.06319.02
5.4.180.0100.05318.96
5.4.170.0200.05018.94
5.4.160.0030.05718.99
5.4.150.0070.05318.98
5.4.140.0030.06016.32
5.4.130.0070.07316.45
5.4.120.0070.07016.57
5.4.110.0170.06316.50
5.4.100.0170.05316.51
5.4.90.0030.05016.48
5.4.80.0000.05316.47
5.4.70.0100.04716.52
5.4.60.0130.04316.39
5.4.50.0070.05016.59
5.4.40.0070.05016.51
5.4.30.0000.05316.44
5.4.20.0070.07016.47
5.4.10.0100.04716.31
5.4.00.0070.04715.84
5.3.290.0120.04812.80
5.3.280.0000.06314.74
5.3.270.0030.05714.80
5.3.260.0100.04714.59
5.3.250.0000.07014.80
5.3.240.0100.04714.80
5.3.230.0030.05314.70
5.3.220.0070.06314.67
5.3.210.0130.06014.80
5.3.200.0030.05314.41
5.3.190.0070.05014.66
5.3.180.0070.04714.71
5.3.170.0070.05014.66
5.3.160.0030.05314.68
5.3.150.0000.06014.77
5.3.140.0070.05014.66
5.3.130.0200.06014.59
5.3.120.0030.05314.65
5.3.110.0030.05314.64
5.3.100.0200.04014.23
5.3.90.0070.04714.12
5.3.80.0000.05314.04
5.3.70.0030.05014.09
5.3.60.0100.04313.98
5.3.50.0100.04314.05
5.3.40.0000.05714.05
5.3.30.0070.05313.94
5.3.20.0200.05013.80
5.3.10.0000.05313.75
5.3.00.0070.07013.73
5.2.170.0100.03711.16
5.2.160.0000.04311.24
5.2.150.0070.04011.23
5.2.140.0100.03711.23
5.2.130.0030.04011.09
5.2.120.0070.05311.20
5.2.110.0000.04311.18
5.2.100.0030.03710.97
5.2.90.0070.03711.20
5.2.80.0000.04311.27
5.2.70.0070.03711.32
5.2.60.0030.04011.05
5.2.50.0100.03310.94
5.2.40.0070.03711.00
5.2.30.0100.03310.97
5.2.20.0030.04011.06
5.2.10.0130.03010.98
5.2.00.0100.03310.70
5.1.60.0000.03710.25
5.1.50.0070.03710.08
5.1.40.0030.0339.99
5.1.30.0070.03010.43
5.1.20.0030.03710.32
5.1.10.0030.03710.15
5.1.00.0070.03310.05
5.0.50.0000.0338.76
5.0.40.0030.0278.58
5.0.30.0000.0438.33
5.0.20.0100.0278.30
5.0.10.0100.0208.23
5.0.00.0070.0378.24
4.4.90.0070.0175.87
4.4.80.0030.0205.84
4.4.70.0030.0205.82
4.4.60.0070.0175.85
4.4.50.0030.0205.82
4.4.40.0000.0375.84
4.4.30.0070.0175.91
4.4.20.0030.0235.88
4.4.10.0000.0235.86
4.4.00.0070.0275.86
4.3.110.0000.0335.79
4.3.100.0030.0175.79
4.3.90.0000.0205.73
4.3.80.0000.0335.75
4.3.70.0070.0275.87
4.3.60.0070.0275.74
4.3.50.0000.0335.74
4.3.40.0170.0275.71
4.3.30.0000.0235.07
4.3.20.0000.0235.07
4.3.10.0070.0175.07
4.3.00.0170.0206.73

preferences:
38.8 ms | 400 KiB | 5 Q