3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class Person { abstract public function name(); function __toString() { return $this->name(); } function a() { return new What(); } } class Her extends Person { public function name() { return "girlFriend"; } } class You extends Person { public function name() { return "you"; } } class Understand { private $y, $i; function __construct(Person $y) { $this->y = $y; $this->i = ""; } function a() { return new What($this->y, $this->i); } function get() { while ($x = mt_rand(0, 5)) { $this->i .= $x; } return $this; } } class What { private $i, $y; function __construct(Person $y, $i) { $this->i = $i; $this->y = $y; } function girlFriend(Person $her) { throw new NullBabeException(sprintf("%s is Needed ASAP Found %s issues with %s ", $her, number_format((int)$this->i), $this->y ), E_CORE_WARNING); } } class NullBabeException extends Exception { function __construct($m){ parent::__construct(sprintf("<h1>%s</h1>",$m)); } } try { if ($you = new Understand(new You())) { $you->get()->a()->girlFriend(new Her()); } } catch ( NullBabeException $e ) { echo $e->getMessage(); } ?> <?php

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.190.3230.04719.14
5.4.180.3430.02718.96
5.4.170.4030.03318.94
5.4.160.3830.03719.20
5.4.150.3570.04319.10
5.4.140.4470.03316.41
5.4.130.4570.03716.61
5.4.120.4230.03016.44
5.4.110.4500.03016.40
5.4.100.4870.04016.58
5.4.90.4330.03316.53
5.4.80.3900.03716.55
5.4.70.4100.03716.35
5.4.60.3800.03316.46
5.4.50.4830.03316.43
5.4.40.3770.03316.53
5.4.30.3970.03316.21
5.4.20.4770.04016.49
5.4.10.4700.03716.42
5.4.00.4670.03715.97
5.3.290.3800.04314.78
5.3.280.3200.03014.81
5.3.270.3900.02714.70
5.3.260.3670.04014.75
5.3.250.3800.04314.67
5.3.240.4270.04014.72
5.3.230.4470.03314.75
5.3.220.3930.03314.69
5.3.210.4700.03714.87
5.3.200.4730.02714.57
5.3.190.4630.04014.68
5.3.180.4170.04014.57
5.3.170.3730.04014.75
5.3.160.4400.03014.66
5.3.150.4870.03314.66
5.3.140.4830.03314.73
5.3.130.4630.05014.69
5.3.120.4800.03314.73
5.3.110.4600.03314.73
5.3.100.4300.04314.15
5.3.90.3070.03314.16
5.3.80.4500.03714.05
5.3.70.3400.06014.16
5.3.60.3270.04314.07
5.3.50.2600.04014.02
5.3.40.3530.03313.98
5.3.30.2030.04013.96
5.3.20.0030.05713.76
5.3.10.3870.03713.71
5.3.00.4370.04013.70
5.2.170.2700.03011.43
5.2.160.3100.03711.41
5.2.150.2930.03311.45
5.2.140.0070.02711.41
5.2.130.0070.06011.27
5.2.120.1230.03311.25
5.2.110.3670.03311.18
5.2.100.3830.03311.37
5.2.90.3970.03711.29
5.2.80.3800.03011.24
5.2.70.3170.02711.39
5.2.60.4000.02311.33
5.2.50.4200.02711.30
5.2.40.2200.03311.26
5.2.30.3070.03011.09
5.2.20.3270.02711.00
5.2.10.3170.02710.90
5.2.00.3200.03310.79
5.1.60.2700.02310.14
5.1.50.2930.02710.14
5.1.40.0030.05710.12
5.1.30.0130.05010.63
5.1.20.0030.06010.51
5.1.10.0070.05710.23
5.1.00.2030.02710.13
5.0.50.1830.0238.61
5.0.40.1700.0178.70
5.0.30.1270.0308.52
5.0.20.1230.0278.50
5.0.10.1500.0238.46
5.0.00.1300.0308.46
4.4.90.1830.0175.82
4.4.80.1900.0175.81
4.4.70.1800.0135.83
4.4.60.1630.0175.85
4.4.50.1530.0175.82
4.4.40.1900.0235.84
4.4.30.0030.0205.79
4.4.20.0000.0375.95
4.4.10.1870.0175.82
4.4.00.1500.0235.82
4.3.110.1530.0175.72
4.3.100.0900.0175.73
4.3.90.1330.0175.71
4.3.80.1670.0305.73
4.3.70.1470.0175.74
4.3.60.1170.0135.69
4.3.50.1300.0135.79
4.3.40.1600.0275.74
4.3.30.0870.0175.16
4.3.20.0670.0205.16
4.3.10.1000.0175.16
4.3.00.0800.0235.16

preferences:
35.21 ms | 400 KiB | 5 Q