3v4l.org

run code in 300+ PHP versions simultaneously
<?php lass Person { public static $company = 'TechBase VietNam'; public function getFriends() { return [ 'John' => function () { return 'John is my best friend!'; }, 'Alan' => function () { return 'Alan is old friend!'; } ]; } public function getFriendOf($someone) { return $this->getFriends()[$someone]; } public static function getNewPerson() { return new Person(); } } // Create instance $person = new Person(); // Get friend echo "\n" . $person->getFriends()['John'] . "\n"; echo "\n" . $person->getFriends('Alan') . "\n"; // Get company echo "\n" . $person::getNewPerson()::$company . "\n";

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)
7.0.00.0100.09020.14
5.6.160.0130.06320.71
5.6.150.0070.05318.17
5.6.140.0130.07318.25
5.6.130.0000.06718.25
5.6.120.0030.04321.02
5.6.110.0130.08021.11
5.6.100.0000.06721.02
5.6.90.0100.05721.12
5.6.80.0070.07720.48
5.5.300.0030.03717.95
5.5.290.0070.07717.95
5.5.280.0100.08720.87
5.5.270.0130.04020.76
5.5.260.0070.04320.64
5.5.250.0030.08320.61
5.5.240.4300.03720.15

preferences:
143.04 ms | 1394 KiB | 7 Q