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.40.0140.00718.64
8.3.30.0090.00620.30
8.3.20.0000.00820.38
8.3.10.0120.00321.96
8.3.00.0030.00522.43
8.2.170.0100.01022.96
8.2.160.0090.00621.87
8.2.150.0080.00024.18
8.2.140.0000.00824.66
8.2.130.0040.00426.16
8.2.120.0000.00719.95
8.2.110.0040.00422.06
8.2.100.0040.00817.84
8.2.90.0000.00719.17
8.2.80.0030.00519.39
8.2.70.0040.00417.63
8.2.60.0070.00317.66
8.2.50.0060.00318.07
8.2.40.0000.00818.22
8.2.30.0050.00518.06
8.2.20.0040.00417.73
8.2.10.0000.00717.79
8.2.00.0030.00817.74
8.1.270.0080.00024.66
8.1.260.0030.00526.35
8.1.250.0050.00328.09
8.1.240.0060.00323.82
8.1.230.0060.00619.01
8.1.220.0040.00417.77
8.1.210.0040.00418.77
8.1.200.0060.00317.36
8.1.190.0050.00317.54
8.1.180.0100.00018.10
8.1.170.0040.00418.48
8.1.160.0000.00720.89
8.1.150.0000.00818.64
8.1.140.0000.00817.41
8.1.130.0030.00317.89
8.1.120.0080.00017.38
8.1.110.0030.00517.32
8.1.100.0000.00717.47
8.1.90.0000.00717.34
8.1.80.0000.00717.43
8.1.70.0030.00317.39
8.1.60.0060.00317.63
8.1.50.0040.00417.51
8.1.40.0040.00417.55
8.1.30.0030.00517.53
8.1.20.0000.00817.70
8.1.10.0030.00617.55
8.1.00.0030.00817.59
8.0.300.0000.00718.77
8.0.290.0040.00417.05
8.0.280.0000.00718.36
8.0.270.0030.00317.27
8.0.260.0000.00616.92
8.0.250.0000.00716.92
8.0.240.0040.00416.93
8.0.230.0030.00316.93
8.0.220.0030.00716.92
8.0.210.0030.00316.88
8.0.200.0070.00016.97
8.0.190.0000.01017.02
8.0.180.0090.00016.98
8.0.170.0000.00816.89
8.0.160.0040.00416.93
8.0.150.0030.00317.00
8.0.140.0040.00416.98
8.0.130.0000.00513.31
8.0.120.0030.00516.90
8.0.110.0040.00416.98
8.0.100.0040.00416.96
8.0.90.0000.00717.07
8.0.80.0120.00916.95
8.0.70.0050.00316.75
8.0.60.0040.00417.03
8.0.50.0050.00316.76
8.0.30.0120.00717.02
8.0.20.0070.01117.40
8.0.10.0080.00017.14
8.0.00.0090.01116.67
7.4.330.0000.00515.04
7.4.320.0040.00416.51
7.4.300.0030.00316.52
7.4.290.0030.00316.51
7.4.280.0040.00416.61
7.4.270.0020.00516.62
7.4.260.0050.00013.15
7.4.250.0030.00516.56
7.4.240.0030.00316.60
7.4.230.0030.00316.65
7.4.220.0000.01716.61
7.4.210.0070.00716.58
7.4.200.0050.00216.58
7.4.190.0040.00416.70
7.4.160.0110.00516.62
7.4.150.0040.01417.40
7.4.140.0110.01017.86
7.4.130.0050.01216.61
7.4.120.0060.01416.63
7.4.110.0080.00816.68
7.4.100.0060.01216.60
7.4.90.0080.00816.51
7.4.80.0100.00719.39
7.4.70.0080.00816.53
7.4.60.0090.00916.52
7.4.50.0090.00016.64
7.4.40.0040.01022.77
7.4.30.0110.00616.45
7.4.10.0100.00614.64
7.4.00.0050.01215.17
7.3.330.0000.00513.30
7.3.320.0050.00013.45
7.3.310.0030.00316.34
7.3.300.0070.00016.34
7.3.290.0070.00716.47
7.3.280.0060.01016.42
7.3.270.0070.01117.40
7.3.260.0060.01016.42
7.3.250.0080.00916.60
7.3.240.0130.00316.65
7.3.230.0070.01016.59
7.3.210.0080.01116.54
7.3.200.0180.00319.39
7.3.190.0110.00716.69
7.3.180.0040.01216.38
7.3.170.0070.01016.31
7.3.160.0040.01116.51
7.3.130.0080.00814.95
7.3.120.0070.01114.67
7.3.110.0060.00914.79
7.3.100.0060.01314.96
7.3.90.0090.00614.89
7.3.80.0060.00615.03
7.3.70.0030.01414.81
7.3.60.0080.00414.90
7.3.50.0090.00614.68
7.3.40.0030.01014.96
7.3.30.0050.00515.02
7.3.20.0030.01016.76
7.3.10.0060.00816.69
7.3.00.0050.00816.76
7.2.330.0060.01216.52
7.2.320.0060.01216.80
7.2.310.0060.01016.87
7.2.300.0170.00316.79
7.2.290.0070.01016.94
7.2.260.0140.00415.37
7.2.250.0070.01015.03
7.2.240.0030.01215.06
7.2.230.0090.00615.09
7.2.220.0150.00015.23
7.2.210.0000.01515.33
7.2.200.0120.00315.02
7.2.190.0030.00914.77
7.2.180.0040.01115.16
7.2.170.0030.01015.06
7.2.160.0110.00714.88
7.2.150.0070.00716.78
7.2.140.0100.00317.13
7.2.130.0040.01016.88
7.2.120.0060.01116.83
7.2.110.0040.00916.96
7.2.100.0080.00716.82
7.2.90.0100.00316.97
7.2.80.0040.01116.97
7.2.70.0080.00817.04
7.2.60.0050.00816.99
7.2.50.0080.00817.04
7.2.40.0050.00717.03
7.2.30.0090.00316.85
7.2.20.0040.01017.03
7.2.10.0070.00516.99
7.2.00.0050.00917.78
7.1.330.0030.01415.66
7.1.320.0030.01415.95
7.1.310.0030.01015.84
7.1.300.0070.00715.85
7.1.290.0000.01115.87
7.1.280.0030.00815.86
7.1.270.0060.00915.52
7.1.260.0060.00615.72
7.1.250.0050.01015.90
7.1.240.0000.01815.82
7.1.230.0040.00815.77
7.1.220.0040.01115.99
7.1.210.0100.00715.92
7.1.200.0060.00615.83
7.1.190.0100.00915.46
7.1.180.0090.00615.84
7.1.170.0110.00415.98
7.1.160.0100.00315.57
7.1.150.0000.01515.93
7.1.140.0030.01415.64
7.1.130.0090.00315.71
7.1.120.0040.01115.97
7.1.110.0030.00915.80
7.1.100.0040.01017.08
7.1.90.0090.00616.04
7.1.80.0100.00715.86
7.1.70.0050.00716.45
7.1.60.0050.00817.66
7.1.50.0040.01316.47
7.1.40.0090.00615.49
7.1.30.0070.01015.94
7.1.20.0130.00315.83
7.1.10.0070.01015.79
7.1.00.0070.03019.07
7.0.330.0070.00615.07
7.0.320.0040.00815.30
7.0.310.0070.00715.20
7.0.300.0090.00015.51
7.0.290.0030.01315.15
7.0.280.0060.00315.43
7.0.270.0070.00715.48
7.0.260.0030.01015.44
7.0.250.0080.00415.39
7.0.240.0030.00915.29
7.0.230.0090.00615.41
7.0.220.0070.01015.45
7.0.210.0070.01015.44
7.0.200.0020.00716.07
7.0.190.0050.00815.30
7.0.180.0040.01415.33
7.0.170.0100.00715.38
7.0.160.0000.01415.57
7.0.150.0070.00715.54
7.0.140.0110.03518.79
7.0.130.0080.00315.46
7.0.120.0000.01615.29
7.0.110.0090.00615.59
7.0.100.0030.01415.51
7.0.90.0000.01715.21
7.0.80.0040.01215.45
7.0.70.1750.01717.60
7.0.60.0090.03417.62
7.0.50.0020.03016.75
7.0.40.0050.05116.93
7.0.30.0300.04316.75
7.0.20.0620.03716.68
7.0.10.0130.03116.86
7.0.00.0120.02016.84
5.6.400.0110.00314.31
5.6.390.0030.01314.39
5.6.380.0120.00314.66
5.6.370.0030.01314.67
5.6.360.0030.00814.45
5.6.350.0050.00514.49
5.6.340.0100.00014.46
5.6.330.0060.00614.77
5.6.320.0070.00714.36
5.6.310.0040.01414.67
5.6.300.0030.01014.81
5.6.290.0000.01114.44
5.6.280.0000.04717.76
5.6.270.0030.01314.56
5.6.260.0060.00614.67
5.6.250.0060.00614.48
5.6.240.0070.00714.42
5.6.230.0070.00714.69
5.6.220.0040.00414.45
5.6.210.0110.02817.68
5.6.200.0180.03516.22
5.6.190.0060.04817.50
5.6.180.0140.04217.54
5.6.170.0130.04717.50
5.6.160.0070.02617.45
5.6.150.0050.03316.27
5.6.140.0050.03716.50
5.6.130.0090.04216.44
5.6.120.0040.02817.96
5.6.110.0110.04117.77
5.6.100.0060.04517.82
5.6.90.0050.04317.89
5.6.80.0000.04417.51
5.6.70.0070.04217.35
5.6.60.0000.00814.50
5.6.50.0030.00914.30
5.6.40.0110.00014.47
5.6.30.0060.00314.34
5.6.20.0030.00914.25
5.6.10.0000.01414.32
5.6.00.0110.00314.33
5.5.380.0100.00714.55
5.5.370.0100.01014.45
5.5.360.0040.00814.52
5.5.350.0050.01817.44
5.5.340.0050.02316.07
5.5.330.0080.04117.26
5.5.320.0080.04317.39
5.5.310.0210.03117.38
5.5.300.0050.02316.38
5.5.290.0050.02716.15
5.5.280.0070.04717.59
5.5.270.0030.04817.52
5.5.260.0120.03517.56
5.5.250.0060.03617.46
5.5.240.0070.03517.22
5.5.230.0030.01014.45
5.5.220.0000.01214.42
5.5.210.0000.01414.41
5.5.200.0030.01014.51
5.5.190.0000.00914.70
5.5.180.0040.01214.46
5.5.170.0060.00914.27
5.5.160.0090.00314.54
5.5.150.0070.00714.69
5.5.140.0070.00314.28
5.5.130.0060.00614.31
5.5.120.0000.01214.42
5.5.110.0060.00914.15
5.5.100.0090.00014.46
5.5.90.0000.01214.45
5.5.80.0060.00914.45
5.5.70.0080.00314.16
5.5.60.0000.00814.45
5.5.50.0110.00414.53
5.5.40.0090.00614.15
5.5.30.0060.00614.72
5.5.20.0110.00714.54
5.5.10.0100.00714.49
5.5.00.0100.00314.56
5.4.450.0330.04215.39
5.4.440.0520.04115.47
5.4.430.0520.03215.54
5.4.420.0060.03015.38
5.4.410.0380.03515.23
5.4.400.0590.02915.23
5.4.390.0080.03015.25
5.4.380.0120.03015.02
5.4.370.0050.02315.03
5.4.360.0020.02614.91
5.4.350.0040.02211.73
5.4.340.0080.01711.65
5.4.330.0030.00911.14
5.4.320.0070.02011.91
5.4.310.0060.02711.79
5.4.300.0060.02011.96
5.4.290.0040.02311.82
5.4.280.0040.02411.74
5.4.270.0040.02311.77
5.4.260.0050.02511.80
5.4.250.0070.02511.82
5.4.240.0080.03715.06
5.4.230.0100.03714.91
5.4.220.0070.03115.07
5.4.210.0020.03315.03
5.4.200.0100.02815.02
5.4.190.0030.04614.99
5.4.180.0140.02915.00
5.4.170.0120.03815.01
5.4.160.0050.03015.10
5.4.150.0050.03114.93
5.4.140.0080.02613.79
5.4.130.0060.03013.82
5.4.120.0110.02413.89
5.4.110.0120.02813.95
5.4.100.0090.03613.82
5.4.90.0120.03213.80
5.4.80.0070.02413.78
5.4.70.0120.02813.78
5.4.60.0080.03613.76
5.4.50.0130.02913.84
5.4.40.0120.02413.88
5.4.30.0080.03513.85
5.4.20.0080.02713.76
5.4.10.0120.03313.83
5.4.00.0090.03513.64
5.3.290.0060.02111.94
5.3.280.0100.03012.89
5.3.270.0130.02812.94
5.3.260.0060.03112.88
5.3.250.0120.03212.88
5.3.240.0080.03212.92
5.3.230.0020.04512.88
5.3.220.0060.03612.81
5.3.210.0080.03412.89
5.3.200.0070.02912.87
5.3.190.0130.03512.87
5.3.180.0120.03012.92
5.3.170.0080.02812.82
5.3.160.0080.02812.87
5.3.150.0120.03612.93
5.3.140.0100.02712.91
5.3.130.0050.03512.86
5.3.120.0070.02812.89
5.3.110.0070.02812.86
5.3.100.0030.03612.57
5.3.90.0050.03812.50
5.3.80.0040.02912.54
5.3.70.0050.03712.54
5.3.60.0070.02712.55
5.3.50.0060.02812.63
5.3.40.0100.02812.55
5.3.30.0070.03812.48
5.3.20.0050.04112.43
5.3.10.0080.03812.36
5.3.00.0090.03712.47
5.2.170.0100.05311.25
5.2.160.0070.04711.25
5.2.150.0000.05711.32
5.2.140.0000.05010.99
5.2.130.0070.05311.18
5.2.120.0000.05011.09
5.2.110.0030.05711.19
5.2.100.0000.05311.07
5.2.90.0070.04711.20
5.2.80.0100.04710.94
5.2.70.0030.04311.19
5.2.60.0070.04011.29
5.2.50.0130.03311.11
5.2.40.0100.04710.97
5.2.30.0100.03711.06
5.2.20.0030.05711.06
5.2.10.0100.03710.88
5.2.00.0070.04710.69
5.1.60.0070.04710.02
5.1.50.0070.03310.25
5.1.40.0070.0309.96
5.1.30.0030.05310.34
5.1.20.0100.04710.45
5.1.10.0070.05010.24
5.1.00.0070.05010.00
5.0.50.0000.0408.61
5.0.40.0030.0278.40
5.0.30.0130.0438.25
5.0.20.0070.0338.30
5.0.10.0000.0308.34
5.0.00.0030.0438.18
4.4.90.0000.0307.30
4.4.80.0000.0237.30
4.4.70.0000.0307.30
4.4.60.0070.0207.30
4.4.50.0030.0207.30
4.4.40.0070.0307.30
4.4.30.0070.0237.30
4.4.20.0070.0207.30
4.4.10.0000.0337.30
4.4.00.0030.0477.30
4.3.110.0030.0307.30
4.3.100.0000.0277.30
4.3.90.0030.0207.30
4.3.80.0000.0377.30
4.3.70.0000.0307.30
4.3.60.0070.0207.30
4.3.50.0070.0177.30
4.3.40.0070.0307.30
4.3.30.0030.0207.30
4.3.20.0000.0237.30
4.3.10.0070.0177.30
4.3.00.0130.0237.26

preferences:
38.14 ms | 400 KiB | 5 Q