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 = saadasdsad String() { $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)
5.4.240.0080.03612.38
5.4.230.0090.03912.38
5.4.220.0070.03712.38
5.4.210.0040.03612.38
5.4.200.0070.03912.38
5.4.190.0040.04512.37
5.4.180.0050.03812.37
5.4.170.0060.03912.38
5.4.160.0070.03712.37
5.4.150.0090.03412.37
5.4.140.0070.03712.06
5.4.130.0060.03612.04
5.4.120.0110.04512.01
5.4.110.0050.03612.00
5.4.100.0110.06412.00
5.4.90.0040.04012.00
5.4.80.0070.03812.00
5.4.70.0040.03812.00
5.4.60.0080.04111.99
5.4.50.0080.03711.99
5.4.40.0070.03411.98
5.4.30.0050.03611.98
5.4.20.0070.03511.97
5.4.10.0080.03411.98
5.4.00.0050.04511.48
5.3.280.0040.03912.71
5.3.270.0070.03812.73
5.3.260.0080.03712.72
5.3.250.0080.03812.72
5.3.240.0050.03812.72
5.3.230.0050.04312.71
5.3.220.0070.04512.68
5.3.210.0070.03812.68
5.3.200.0090.03912.68
5.3.190.0060.04112.68
5.3.180.0070.03512.67
5.3.170.0080.03612.67
5.3.160.0080.03912.68
5.3.150.0050.03812.67
5.3.140.0070.03512.66
5.3.130.0040.04412.66
5.3.120.0070.03912.66
5.3.110.0040.04012.66
5.3.100.0050.03812.12
5.3.90.0040.03812.08
5.3.80.0050.03612.07
5.3.70.0090.03212.07
5.3.60.0070.03612.06
5.3.50.0070.03512.00
5.3.40.0060.03512.00
5.3.30.0050.03511.95
5.3.20.0050.03611.73
5.3.10.0070.03911.70
5.3.00.0100.03611.68

preferences:
143.17 ms | 1394 KiB | 7 Q