3v4l.org

run code in 300+ PHP versions simultaneously
<?php class World { static $id = 0; protected $uid; protected $worldName; const $type = 'world'; public function __construct( $worldName ) { $this->setUID(); $this->wrldName = $worldName; } private function setUID() { $this->uid = self::$id++; } public function whoIsPerson( Person $person ) { $personUID = $person->getUID(); if( $personUID === 0 && $this->name === 'Rapture' ) return 'Jack'; elseif( $personUID === 0 && $this->name === 'Columbia' ) return 'Elizabeth'; else return 'Unknown Person'; } } class Person { static $id = 0; protected $uid; private function setUID() { $this->uid = self::$id++; } public function getUID() { return $this->uid; } } $person1 = new Person(); $world1 = new World('Rapture'); echo $world1->whoIsPerson( $person1 ); $world2 = new World('Columbia'); echo $world2->whoIsPerson( $person1 );

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.5.10.0000.08317.23
5.5.00.0170.07017.19
5.4.170.0100.06319.09
5.4.160.0100.07319.07
5.4.150.0100.04719.07
5.4.140.0030.03716.54
5.4.130.0000.06716.41
5.4.120.0100.06716.38
5.4.110.0030.05016.40
5.4.100.0070.06716.50
5.4.90.0030.06716.38
5.4.80.0070.04316.37
5.4.70.0100.03016.30
5.4.60.0070.04016.38
5.4.50.0000.05716.38
5.4.40.0030.03716.61
5.4.30.0100.03016.43
5.4.20.0070.03316.41
5.4.10.0030.04716.35
5.4.00.0100.03315.79
5.3.270.0000.06714.66
5.3.260.0030.07314.61
5.3.250.0100.06714.68
5.3.240.0130.06314.68
5.3.230.0100.04314.60
5.3.220.0100.04014.55
5.3.210.0170.06314.61
5.3.200.0000.05014.77
5.3.190.0030.06014.58
5.3.180.0030.06714.60
5.3.170.0000.05714.57
5.3.160.0030.07714.52
5.3.150.0130.06714.62
5.3.140.0030.04314.50
5.3.130.0070.03714.63
5.3.120.0030.04014.64
5.3.110.0130.03314.50
5.3.100.0000.04013.99
5.3.90.0000.07014.05
5.3.80.0130.05714.07
5.3.70.0030.07714.03
5.3.60.0030.05013.98
5.3.50.0030.06713.95
5.3.40.0100.07013.95
5.3.30.0070.06013.89
5.3.20.0130.06713.69
5.3.10.0230.02713.68
5.3.00.0100.06313.50

preferences:
148 ms | 1394 KiB | 7 Q