3v4l.org

run code in 300+ PHP versions simultaneously
<?php class testobj{ public $id; public $username; public $email; private function setId($id){ $this->id = $id; } private function setUsername($un){ $this->username = $un; } private function setEmail($email){ $this->email = $email; } public function load($i,$u,$e){ $this->setId($i); $this->setUsername($u); $this->setEmail($e); } } $test1 = new testobj(); $test1->load('1',"richardgow","richard.gow@tracesmart.co.uk"); $test2 = new testobj(); $test2->load('2',"emailtest1","richard.gow@tracesmart.co.uk"); $test3 = new testobj(); $test3->load('3',"emailtest2","richard.gow@tracesmart.co.uk"); $test4 = new testobj(); $test4->load('4',"emailtest3","richard.gow@tracesamrt.co.uk"); $testhold = Array(); $testhold[0] = $test1; $testhold[1] = $test2; $testhold[2] = $test3; $testhold[3] = $test4; $urlarr = array( 0 => "www.test1.com", 1 => "www.test2.com", 2 => "www.test3.com", 3 => "www.test4.com" ); //fake url helper class urlmake { static public function makeUrl($input){ return "www." . $input->username . ".com"; } } //all above test code -- below implemenation $tableouter = '<table border="1" style="width:100%">'; $tableend = "</table>"; $row = "<tr>"; $td = "<td>"; $tdend = "</td>"; $rowend = "</tr>"; $htmlinsert = ""; $htmlContent = "<p>A request has been made to reset your password on the Tracesmart 'Single Sign On' system. Your username is.</p> <p>Please visit the following URL in order to reset your password:<br/>"; $plainContent = strip_tags(html_entity_decode($htmlContent)); $htmlinsert = $plainContent; $htmlinsert = $htmlinsert . $tableouter; for($i = 0; $i < count($testhold); $i++){ $htmlinsert = $htmlinsert . $row . $td . $testhold[$i]->username . $tdend . $td . urlmake::makeUrl($testhold[$i]) . $tdend . $rowend ; } $htmlinsert = $htmlinsert . $tableend; echo $htmlinsert; //actual implmentation of function to move the url gen out of the code. private function outPutUrl($token){ $url = $this->_helper->url->url( array( 'module' => 'sso', 'controller' => 'password', 'action' => 'reset', 'token' => $token, 'scheme' => 'https', ) ); return $url; } //code for calling this being $this->outPutUrl($token); ?>

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.340.0600.00019.09
5.4.320.0040.04212.54
5.4.310.0060.04512.54
5.4.300.0070.04712.54
5.4.290.0070.04112.53
5.4.280.0080.03512.43
5.4.270.0080.03912.43
5.4.260.0070.05012.43
5.4.250.0070.04512.43
5.4.240.0110.04112.43
5.4.230.0090.04312.42
5.4.220.0020.04012.42
5.4.210.0070.03412.42
5.4.200.0100.03412.42
5.4.190.0050.04312.41
5.4.180.0120.06312.42
5.4.170.0030.04512.43
5.4.160.0080.04012.42
5.4.150.0080.04012.41
5.4.140.0070.03912.11
5.4.130.0070.03612.09
5.4.120.0090.03412.05
5.4.110.0070.03812.05
5.4.100.0060.04112.05
5.4.90.0070.04412.05
5.4.80.0110.04312.05
5.4.70.0060.04212.04
5.4.60.0100.03612.05
5.4.50.0040.03912.04
5.4.40.0030.03812.04
5.4.30.0070.03412.04
5.4.20.0060.04212.03
5.4.10.0050.03812.04
5.4.00.0070.03611.52
5.3.290.0070.03912.80
5.3.280.0070.04012.71
5.3.270.0080.04212.72
5.3.260.0070.04612.72
5.3.250.0150.08612.72
5.3.240.0070.04812.72
5.3.230.0060.04412.70
5.3.220.0060.03812.68
5.3.210.0060.04412.68
5.3.200.0090.03612.68
5.3.190.0050.04912.68
5.3.180.0070.04412.68
5.3.170.0070.03912.67
5.3.160.0220.07612.68
5.3.150.0080.04312.68
5.3.140.0090.03812.66
5.3.130.0020.04312.66
5.3.120.0050.04212.66
5.3.110.0040.04212.65
5.3.100.0070.04312.14
5.3.90.0070.03512.12
5.3.80.0050.04212.11
5.3.70.0090.05512.12
5.3.60.0060.04812.10
5.3.50.0040.04112.05
5.3.40.0080.03612.05
5.3.30.0050.04012.00
5.3.20.0090.04011.79
5.3.10.0080.03411.75
5.3.00.0060.03711.74
5.2.170.0050.0319.25
5.2.160.0040.0309.25
5.2.150.0050.0309.25
5.2.140.0030.0449.24
5.2.130.0070.0299.20
5.2.120.0060.0409.20
5.2.110.0070.0279.21
5.2.100.0050.0309.20
5.2.90.0040.0329.20
5.2.80.0040.0349.20
5.2.70.0040.0329.20
5.2.60.0070.0319.16
5.2.50.0050.0309.12
5.2.40.0020.0339.10
5.2.30.0040.0399.07
5.2.20.0090.0299.06
5.2.10.0040.0348.97
5.2.00.0030.0318.84
5.1.60.0050.0238.13
5.1.50.0050.0248.13
5.1.40.0040.0288.10
5.1.30.0060.0268.45
5.1.20.0030.0288.48
5.1.10.0030.0308.20
5.1.00.0040.0278.20
5.0.50.0060.0206.67
5.0.40.0030.0226.54
5.0.30.0040.0336.35
5.0.20.0040.0226.31
5.0.10.0070.0236.29
5.0.00.0040.0376.28
4.4.90.0030.0154.78
4.4.80.0020.0184.75
4.4.70.0020.0194.76
4.4.60.0030.0154.75
4.4.50.0040.0144.77
4.4.40.0030.0254.71
4.4.30.0040.0144.76
4.4.20.0040.0174.85
4.4.10.0050.0144.85
4.4.00.0030.0264.76
4.3.110.0050.0164.67
4.3.100.0000.0214.66
4.3.90.0020.0164.63
4.3.80.0020.0294.58
4.3.70.0060.0184.63
4.3.60.0140.0334.63
4.3.50.0020.0184.62
4.3.40.0020.0244.54
4.3.30.0020.0173.30
4.3.20.0020.0163.28
4.3.10.0030.0213.23
4.3.00.0000.02013.59

preferences:
144.36 ms | 1394 KiB | 7 Q