3v4l.org

run code in 300+ PHP versions simultaneously
<?php class table{ //COLUMN NAMES private $cname1 = "ID"; private $cname2 = "name"; private $cname3 = "email"; //etc. //Table private $table1 = "<table align='center'>"; //DOESNT WORK private $table2 = "<table>"; //WORKS public function __construct(){ $this->loadTop(); $this->loadData(); } //loads top row. public function loadTop(){ //If I echo this line it gives the error echo $this->table1."<tr>"; //DOESNT WORK //but If I echo this line there is no problem. echo $this->table2."<tr>"; //WORKS echo "<td>".$this->cname1."</td>"; echo etc."</tr>"; } //loads data from database and adds to table. public function loadData(){ while($row = mysqli_fetch_array($result)){ echo "<tr><td>"; echo $row['ID']; echo etc."</tr>"; } echo "</table>"; } //Now the great thing comes. This does work though. echo $this->table1."<tr><td>Hello</td></tr>"; echo "<tr><td>World</td></tr></table>";

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.290.0070.05412.50
5.4.280.0070.05912.40
5.4.270.0100.03712.40
5.4.260.0070.05312.40
5.4.250.0100.06212.40
5.4.240.0100.04812.40
5.4.230.0190.06612.39
5.4.220.0080.06612.39
5.4.210.0170.06612.39
5.4.200.0070.04312.39
5.4.190.0120.05212.39
5.4.180.0060.04112.39
5.4.170.0080.09012.40
5.4.160.0070.03912.39
5.4.150.0070.04212.39
5.4.140.0060.04012.08
5.4.130.0070.03712.06
5.4.120.0080.03712.02
5.4.110.0080.03712.02
5.4.100.0080.04612.02
5.4.90.0140.04912.02
5.4.80.0140.05812.02
5.4.70.0070.05112.02
5.4.60.0100.04712.02
5.4.50.0100.04912.02
5.4.40.0060.03512.00
5.4.30.0100.04812.00
5.4.20.0060.04012.00
5.4.10.0040.04112.01
5.4.00.0070.06811.50
5.3.280.0100.04312.71
5.3.270.0060.05112.72
5.3.260.0040.05212.72
5.3.250.0030.04412.72
5.3.240.0090.03912.72
5.3.230.0160.03812.71
5.3.220.0060.03812.68
5.3.210.0110.04412.68
5.3.200.0100.05112.68
5.3.190.0050.04012.68
5.3.180.0040.04112.67
5.3.170.0050.04112.67
5.3.160.0040.03912.67
5.3.150.0030.04312.67
5.3.140.0060.03812.66
5.3.130.0060.04412.66
5.3.120.0070.03812.66
5.3.110.0050.03912.66
5.3.100.0050.03812.13
5.3.90.0060.03712.11
5.3.80.0080.03712.10
5.3.70.0070.05012.10
5.3.60.0090.03712.09
5.3.50.0050.04412.04
5.3.40.0090.04312.03
5.3.30.0130.05811.99
5.3.20.0120.05611.77
5.3.10.0040.05411.75
5.3.00.0060.05311.72

preferences:
140.75 ms | 1394 KiB | 7 Q