3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class parentTest{ protected $innerVar = ''; public function __construct() { if(empty($this->innerVar)){ echo 'too soon'; throw(new Exception('too soon')); } }}abstract class childTest extends parentTest{ protected $outerVar = ''; public function __construct() { if(empty($this->innerVar) || empty($this->outerVar)){ echo 'too soon'; throw(new Exception('too soon')); } }}class implTest extends parentTest{ protected $innerVar = 'hi';}class implChildTest extends childTest{ protected $innerVar = 'hi'; protected $outerVar = 'hello there';}new implTest();new implChildTest();<?php abstract class parentTest{ protected $innerVar;}class implTest{ protected $innerVar = 'hi'; public function __construct() { if(empty($this->innerVar)){ throw(new Exception('too soon')); } }}new implTest();

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.310.0080.03812.52
5.4.300.0090.04312.53
5.4.290.0060.03812.52
5.4.280.0090.03212.41
5.4.270.0080.03412.41
5.4.260.0060.03712.41
5.4.250.0110.03212.41
5.4.240.0080.03312.41
5.4.230.0100.03712.40
5.4.220.0100.03512.41
5.4.210.0050.03612.40
5.4.200.0060.03812.40
5.4.190.0090.03412.40
5.4.180.0060.04512.40
5.4.170.0070.04412.41
5.4.160.0080.03812.41
5.4.150.0100.03412.40
5.4.140.0040.03912.09
5.4.130.0080.03312.07
5.4.120.0090.03312.04
5.4.110.0070.04212.03
5.4.100.0070.03912.04
5.4.90.0090.03512.04
5.4.80.0060.03712.04
5.4.70.0080.03412.03
5.4.60.0090.03212.03
5.4.50.0050.03912.03
5.4.40.0070.03412.02
5.4.30.0060.05012.01
5.4.20.0060.03612.01
5.4.10.0050.03512.01
5.4.00.0030.03911.51
5.3.280.0030.04112.71
5.3.270.0080.04512.73
5.3.260.0060.04212.72
5.3.250.0110.04012.72
5.3.240.0070.04712.72
5.3.230.0090.04212.71
5.3.220.0060.03612.68
5.3.210.0040.04412.68
5.3.200.0070.03912.68
5.3.190.0060.04112.68
5.3.180.0050.03812.68
5.3.170.0070.03512.67
5.3.160.0060.03712.68
5.3.150.0060.03712.68
5.3.140.0050.03812.66
5.3.130.0090.04412.66
5.3.120.0080.04512.66
5.3.110.0030.04212.66
5.3.100.0040.04012.13
5.3.90.0070.03612.11
5.3.80.0040.04012.11
5.3.70.0060.03712.10
5.3.60.0100.03712.09
5.3.50.0100.03412.04
5.3.40.0030.04112.04
5.3.30.0070.03511.99
5.3.20.0040.03611.77
5.3.10.0050.03511.74
5.3.00.0040.03911.73
5.2.170.0050.0319.23
5.2.160.0050.0309.23
5.2.150.0050.0309.23
5.2.140.0050.0419.22
5.2.130.0030.0309.19
5.2.120.0080.0289.18
5.2.110.0050.0299.19
5.2.100.0050.0289.18
5.2.90.0040.0359.18
5.2.80.0020.0379.18
5.2.70.0050.0329.18
5.2.60.0050.0319.14
5.2.50.0060.0299.11
5.2.40.0030.0309.09
5.2.30.0040.0299.05
5.2.20.0060.0269.05
5.2.10.0030.0288.95
5.2.00.0060.0268.82
5.1.60.0050.0238.11
5.1.50.0040.0278.09
5.1.40.0060.0278.07
5.1.30.0050.0338.43
5.1.20.0040.0268.45
5.1.10.0050.0258.18
5.1.00.0020.0288.17
5.0.50.0040.0206.65
5.0.40.0020.0216.52
5.0.30.0050.0316.32
5.0.20.0060.0176.29
5.0.10.0060.0186.27
5.0.00.0040.0306.27
4.4.90.0040.0144.78
4.4.80.0030.0144.76
4.4.70.0020.0164.76
4.4.60.0040.0144.75
4.4.50.0020.0164.77
4.4.40.0030.0244.71
4.4.30.0030.0144.76
4.4.20.0030.0144.84
4.4.10.0040.0144.85
4.4.00.0020.0254.76
4.3.110.0020.0164.67
4.3.100.0040.0134.66
4.3.90.0050.0124.64
4.3.80.0030.0254.59
4.3.70.0010.0194.63
4.3.60.0030.0194.63
4.3.50.0010.0184.63
4.3.40.0020.0264.54
4.3.30.0020.0183.28
4.3.20.0030.0163.25
4.3.10.0020.0213.22
4.3.00.0200.01715.90

preferences:
136.55 ms | 1398 KiB | 7 Q