3v4l.org

run code in 300+ PHP versions simultaneously
<?php class namedClass{ protected $prop; public function __construct($value){ $this->prop = $value; } public function returnProperty($propName){ if( !empty($this->$propName) ){ return $this->$prop; }else{ return null; } } } $standardObject = new namedCLass('The named class'); echo $standardObject->returnProperty('prop')."\n"; class namedExtension extends namedClass{ public function returnProperty($propName){ if( !empty($this->$propName) ){ return $this->$prop.' from standard extenstion'; }else{ return null; } } $extObject = new namedExtension('The named extension'); echo $extObject->returnProperty('prop')."\n"; $anonObj = new class('The anonymous class') extends namedClass{ public function returnProperty($propName){ if( !empty($this->$propName) ){ return $this->$prop.' from anonymous class'; }else{ return null; } } }; echo $newObj->returnProperty();

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.6.140.0030.07318.19
5.6.130.0070.08718.15
5.6.120.0000.08721.16
5.6.110.0100.07720.99
5.6.100.0100.05021.13
5.6.90.0030.04021.07
5.6.80.0100.07320.38
5.5.300.0070.05017.97
5.5.290.0170.07017.93
5.5.280.0070.08320.79
5.5.270.0070.07020.88
5.5.260.0030.07020.89
5.5.250.0070.06020.59
5.5.240.0070.07320.20
5.4.450.0570.06019.54
5.4.440.0600.05719.58
5.4.430.0670.05319.16
5.4.420.0670.05019.40
5.4.410.0730.04719.43
5.4.400.1100.06719.11
5.4.390.0870.07319.23
5.4.380.0870.05019.07
5.4.370.0730.06319.30
5.4.360.0770.06019.08
5.4.350.0800.05319.07
5.4.340.0800.05719.09
5.4.320.0770.05718.84
5.4.310.0670.04719.08
5.4.300.0670.05019.05
5.4.290.0600.05718.84
5.4.280.0800.06318.86
5.4.270.0830.05019.23
5.4.260.0930.05019.22
5.4.250.0900.04718.90
5.4.240.0770.04318.83
5.4.230.0600.05318.83
5.4.220.0570.05719.25
5.4.210.0870.05019.07
5.4.200.0670.05019.05
5.4.190.0900.04319.08
5.4.180.0600.05319.05
5.4.170.0570.05719.20
5.4.160.0700.04719.19
5.4.150.0700.04319.12
5.4.140.0700.04316.60
5.4.130.0800.04016.51
5.4.120.0830.04316.39
5.4.110.0730.05716.66
5.4.100.0800.05016.65
5.4.90.0770.05016.60
5.4.80.0900.04016.61
5.4.70.0230.05716.23
5.4.60.0300.05016.43
5.4.50.0370.06016.33
5.4.40.0130.05316.53
5.4.30.0270.04716.54
5.4.20.0200.04016.48
5.4.10.0300.05716.38

preferences:
139.01 ms | 1394 KiB | 7 Q