3v4l.org

run code in 300+ PHP versions simultaneously
<?php class TestSampleClass { } /** * @category Zend * @package Zend_Reflection */ class ParameterReflection extends ReflectionParameter { /** * @var bool */ protected $isFromMethod = false; /** * Get declaring class reflection object * * @return ClassReflection */ public function getDeclaringClass() { $phpReflection = parent::getDeclaringClass(); $zendReflection = new ReflectionClass($phpReflection->getName()); unset($phpReflection); return $zendReflection; } /** * Get class reflection object * * @return ClassReflection */ public function getClass() { $phpReflection = parent::getClass(); if ($phpReflection == null) { return null; } $zendReflection = new ClassReflection($phpReflection->getName()); unset($phpReflection); return $zendReflection; } /** * Get declaring function reflection object * * @param string $reflectionClass Reflection class to use * @return FunctionReflection|MethodReflection */ public function getDeclaringFunction($reflectionClass = null) { $phpReflection = parent::getDeclaringFunction(); if ($phpReflection instanceof ReflectionMethod) { $zendReflection = new ReflectionMethod($this->getDeclaringClass()->getName(), $phpReflection->getName()); } else { $zendReflection = new ReflectionFunction($phpReflection->getName()); } unset($phpReflection); return $zendReflection; } /** * Get parameter type * * @return string */ public function getType() { $type = null; $checkDefault = true; if ($this->isArray()) { $type = 'array'; } elseif (($class = $this->getClass()) instanceof ReflectionClass) { $type = $class->getName(); } elseif ($docBlock = $this->getDeclaringFunction()->getDocBlock()) { $params = $docBlock->getTags('param'); if (isset($params[$this->getPosition()])) { $type = $params[$this->getPosition()]->getType(); $checkDefault = false; } } if ($this->isDefaultValueAvailable() && $checkDefault) { if ($type === null) { $value = $this->getDefaultValue(); $type = strtolower(gettype($value)); switch ($type) { case 'boolean' : $type = 'bool'; break; case 'integer' : $type = 'int'; break; } } else { if ($this->getDefaultValue() === null) { $type .= '|null'; } } } return $type; } public function toString() { return parent::__toString(); } public function __toString() { return parent::__toString(); } } /** * TestSampleClass5 DocBlock Short Desc * * This is a long description for * the docblock of this class, it * should be longer than 3 lines. * It indeed is longer than 3 lines * now. * * @author Ralph Schindler <ralph.schindler@zend.com> * @method test() * @property $test */ class TestSampleClass5 { /** * Method ShortDescription * * Method LongDescription * This is a long description for * the docblock of this class, it * should be longer than 3 lines. * It indeed is longer than 3 lines * now. * * @param int $one Description for one * @param int Description for two * @param string $three Description for three * which spans multiple lines * @return mixed Some return descr */ public function doSomething($one, $two = 2, $three = 'three', $empty, $string = 'somestring', $null = null, $int = 1, $bool = true, array $array, array $arrayOrNull = null, TestSampleClass $class, TestSampleClass $classOrNull = null) { return 'mixedValue'; } /** * Method ShortDescription * * @param int $one Description for one * @param int Description for two * @param string $three Description for three * which spans multiple lines * @return int */ public function doSomethingElse($one, $two = 2, $three = 'three') { return 'mixedValue'; } } $tests = array( array('one', 'int'), array('two', 'int'), array('three', 'string'), array('empty', null), array('string', 'string'), array('null', 'null'), array('int', 'int'), array('bool', 'bool'), array('array', 'array'), array('arrayOrNull','array|null'), array('class', 'ZendTest\Code\Reflection\TestAsset\TestSampleClass'), array('classOrNull','ZendTest\Code\Reflection\TestAsset\TestSampleClass|null'), ); foreach($tests as $test) { $param = new ParameterReflection(array('TestSampleClass5', 'doSomething'), $test[0]); var_dump($param->getType()); }

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)
8.3.40.0110.00418.71
8.3.30.0040.01119.09
8.3.20.0040.00420.35
8.3.10.0090.00022.08
8.3.00.0030.00622.32
8.2.170.0090.00922.96
8.2.160.0060.01520.89
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0080.00017.63
8.2.110.0060.00322.29
8.2.100.0070.00419.58
8.2.90.0000.00819.22
8.2.80.0030.00519.66
8.2.70.0000.00917.75
8.2.60.0050.00317.93
8.2.50.0000.00818.07
8.2.40.0000.00818.34
8.2.30.0040.00418.24
8.2.20.0070.00017.82
8.2.10.0040.00417.86
8.2.00.0000.01117.91
8.1.270.0080.00022.13
8.1.260.0080.00026.35
8.1.250.0030.00628.09
8.1.240.0000.00924.01
8.1.230.0060.00619.17
8.1.220.0050.00317.74
8.1.210.0040.00418.77
8.1.200.0030.00617.48
8.1.190.0030.00617.78
8.1.180.0040.00418.10
8.1.170.0000.00818.76
8.1.160.0050.00222.06
8.1.150.0040.00418.76
8.1.140.0110.00017.50
8.1.130.0030.00317.79
8.1.120.0000.00717.56
8.1.110.0000.00817.52
8.1.100.0000.00717.54
8.1.90.0000.00717.47
8.1.80.0070.00017.50
8.1.70.0030.00517.43
8.1.60.0060.00317.63
8.1.50.0030.00517.47
8.1.40.0040.00417.57
8.1.30.0000.00917.71
8.1.20.0040.00417.68
8.1.10.0000.00817.56
8.1.00.0030.00517.64
8.0.300.0030.00618.77
8.0.290.0060.00317.30
8.0.280.0000.00718.55
8.0.270.0040.00417.28
8.0.260.0040.00417.00
8.0.250.0030.00317.10
8.0.240.0050.00317.07
8.0.230.0030.00417.13
8.0.220.0000.00817.00
8.0.210.0030.00517.08
8.0.200.0070.00017.08
8.0.190.0030.00516.95
8.0.180.0040.00416.93
8.0.170.0050.00216.97
8.0.160.0000.00917.01
8.0.150.0020.00516.96
8.0.140.0040.00416.87
8.0.130.0030.00313.50
8.0.120.0050.00217.02
8.0.110.0030.00517.02
8.0.100.0030.00516.96
8.0.90.0040.00417.08
8.0.80.0060.00917.03
8.0.70.0040.00417.04
8.0.60.0040.00417.06
8.0.50.0040.00417.07
8.0.30.0110.00817.15
8.0.20.0070.01517.40
8.0.10.0040.00417.12
8.0.00.0110.00916.64
7.4.330.0050.00015.20
7.4.320.0030.00316.46
7.4.300.0000.00616.57
7.4.290.0100.00016.64
7.4.280.0000.00916.47
7.4.270.0040.00416.54
7.4.260.0000.00716.64
7.4.250.0050.00316.60
7.4.240.0050.00216.56
7.4.230.0040.00416.67
7.4.220.0090.00916.55
7.4.210.0080.00816.60
7.4.200.0040.00416.53
7.4.190.0000.00716.71
7.4.160.0100.00716.64
7.4.150.0070.01017.40
7.4.140.0120.01017.86
7.4.130.0080.01316.52
7.4.120.0080.01016.61
7.4.110.0070.01016.46
7.4.100.0140.00316.71
7.4.90.0070.01016.60
7.4.80.0070.01019.39
7.4.70.0030.01716.52
7.4.60.0060.01216.50
7.4.50.0030.00616.54
7.4.40.0050.00822.77
7.4.30.0030.01316.77
7.4.10.0070.01114.89
7.4.00.0070.01015.05
7.3.330.0000.00513.48
7.3.320.0030.00313.55
7.3.310.0000.00816.37
7.3.300.0030.00316.52
7.3.290.0140.00416.49
7.3.280.0090.01116.45
7.3.270.0120.00617.40
7.3.260.0100.00716.66
7.3.250.0140.00616.66
7.3.240.0160.00616.48
7.3.230.0040.01616.43
7.3.210.0040.01416.71
7.3.200.0130.00319.39
7.3.190.0110.01116.50
7.3.180.0130.00416.32
7.3.170.0100.00616.55
7.3.160.0100.00716.55
7.3.130.0030.01414.84
7.3.120.0100.00714.92
7.3.110.0100.01015.13
7.3.100.0040.01214.84
7.3.90.0090.00615.18
7.3.80.0060.00315.07
7.3.70.0070.00714.98
7.3.60.0060.00314.96
7.3.50.0030.00514.90
7.3.40.0090.00514.95
7.3.30.0060.00914.79
7.3.20.0060.00916.89
7.3.10.0080.00816.61
7.3.00.0120.00316.81
7.2.330.0020.02116.85
7.2.320.0080.01416.45
7.2.310.0150.00716.82
7.2.300.0100.00616.81
7.2.290.0060.01316.48
7.2.260.0130.00614.91
7.2.250.0100.01014.97
7.2.240.0030.00915.36
7.2.230.0000.01814.74
7.2.220.0040.01415.08
7.2.210.0040.00715.01
7.2.200.0030.01015.12
7.2.190.0060.00915.17
7.2.180.0040.00415.29
7.2.170.0110.00315.11
7.2.160.0030.01315.13
7.2.150.0100.00316.96
7.2.140.0060.00616.82
7.2.130.0000.00917.10
7.2.120.0060.00917.00
7.2.110.0030.01316.93
7.2.100.0060.00917.00
7.2.90.0000.01017.04
7.2.80.0030.01017.00
7.2.70.0060.01317.00
7.2.60.0040.00916.93
7.2.50.0060.00916.88
7.2.40.0100.00316.94
7.2.30.0060.00917.03
7.2.20.0090.00917.02
7.2.10.0130.00717.01
7.2.00.0080.00518.07
7.1.330.0000.01215.69
7.1.320.0070.01015.62
7.1.310.0040.00815.98
7.1.300.0090.00015.82
7.1.290.0040.00415.82
7.1.280.0080.00415.64
7.1.270.0030.01315.81
7.1.260.0030.00616.02
7.1.250.0110.00316.00
7.1.240.0070.00715.75
7.1.230.0110.00015.98
7.1.220.0110.00615.68
7.1.210.0030.01015.86
7.1.200.0030.00815.80
7.1.190.0070.01015.88
7.1.180.0070.01115.61
7.1.170.0090.00915.95
7.1.160.0100.00315.88
7.1.150.0040.01215.56
7.1.140.0040.00715.95
7.1.130.0030.00715.62
7.1.120.0040.00715.86
7.1.110.0030.01015.95
7.1.100.0110.00816.98
7.1.90.0030.00615.71
7.1.80.0080.00415.94
7.1.70.0050.00716.46
7.1.60.0090.00917.84
7.1.50.0070.01016.25
7.1.40.0070.00715.96
7.1.30.0030.01215.96
7.1.20.0070.00715.85
7.1.10.0060.00615.70
7.1.00.0020.04619.15
7.0.330.0050.00515.23
7.0.320.0070.01015.48
7.0.310.0100.00315.32
7.0.300.0070.01015.27
7.0.290.0100.00315.35
7.0.280.0030.00715.46
7.0.270.0070.00715.45
7.0.260.0040.00815.41
7.0.250.0100.00315.56
7.0.240.0030.01215.57
7.0.230.0030.01015.10
7.0.220.0040.00715.14
7.0.210.0060.00315.50
7.0.200.0030.00816.06
7.0.190.0030.01015.38
7.0.180.0040.01115.16
7.0.170.0060.00615.43
7.0.160.0030.00915.41
7.0.150.0030.00715.43
7.0.140.0050.04318.83
7.0.130.0040.00715.61
7.0.120.0070.00715.54
7.0.110.0000.01315.39
7.0.100.0070.03317.75
7.0.90.0050.04817.68
7.0.80.0050.02917.67
7.0.70.0050.04217.73
7.0.60.0050.02517.72
7.0.50.0270.04217.96
7.0.40.0080.04216.87
7.0.30.0100.04016.72
7.0.20.0060.04516.75
7.0.10.0070.04316.84
7.0.00.0070.05216.82
5.6.400.0100.00014.35
5.6.390.0000.01314.04
5.6.380.0000.00914.55
5.6.370.0070.01114.09
5.6.360.0040.00814.70
5.6.350.0030.00614.59
5.6.340.0030.01214.41
5.6.330.0090.00314.40
5.6.320.0060.00314.52
5.6.310.0000.01514.71
5.6.300.0040.01114.75
5.6.290.0060.00914.45
5.6.280.0110.03617.83
5.6.270.0040.00414.16
5.6.260.0000.01514.60
5.6.250.0030.04517.55
5.6.240.0060.04817.59
5.6.230.0150.03517.56
5.6.220.0050.03717.59
5.6.210.0030.03517.58
5.6.200.0070.03517.76
5.6.190.0080.02717.79
5.6.180.0100.03317.80
5.6.170.0100.03517.80
5.6.160.0090.04417.83
5.6.150.0100.04117.65
5.6.140.0070.04817.74
5.6.130.0080.04317.71
5.6.120.0160.03517.63
5.6.110.0050.02817.70
5.6.100.0050.03117.72
5.6.90.0130.04017.75
5.6.80.0070.04317.32
5.6.70.0030.03817.33
5.6.60.0100.02717.45
5.6.50.0100.04017.34
5.6.40.0050.04417.39
5.6.30.0070.04217.50
5.6.20.0070.04617.35
5.6.10.0050.04117.47
5.6.00.0030.03817.45
5.5.380.0110.03717.45
5.5.370.0080.02717.42
5.5.360.0030.04017.44
5.5.350.0080.04317.47
5.5.340.0090.04817.45
5.5.330.0080.04617.74
5.5.320.0100.04217.61
5.5.310.0070.02817.65
5.5.300.0070.03917.62
5.5.290.0150.02817.58
5.5.280.0050.04217.73
5.5.270.0100.04617.68
5.5.260.0070.03817.65
5.5.250.0050.03117.56
5.5.240.0050.03517.34
5.5.230.0110.04317.30
5.5.220.0070.04117.19
5.5.210.0110.03617.24
5.5.200.0080.02317.34
5.5.190.0070.04217.10
5.5.180.0050.04117.32
5.5.170.0070.00314.29
5.5.160.0050.04517.34
5.5.150.0070.03717.35
5.5.140.0170.03817.27
5.5.130.0060.04417.27
5.5.120.0050.02717.14
5.5.110.0120.03817.36
5.5.100.0110.03117.26
5.5.90.0060.04317.14
5.5.80.0050.04517.20
5.5.70.0030.03117.16
5.5.60.0130.03217.31
5.5.50.0120.03517.23
5.5.40.0080.04217.04
5.5.30.0140.02817.23
5.5.20.0130.03617.21
5.5.10.0080.04017.35
5.5.00.0060.03817.21
5.4.450.0090.03616.34
5.4.440.0100.03916.38
5.4.430.0030.04616.39
5.4.420.0090.03716.41
5.4.410.0080.02316.31
5.4.400.0050.04316.21
5.4.390.0030.04516.27
5.4.380.0020.03416.18
5.4.370.0070.04216.09
5.4.360.0080.04116.18
5.4.350.0000.04616.17
5.4.340.0050.03516.17
5.4.330.0110.00013.30
5.4.320.0050.03216.27
5.4.310.0030.04416.09
5.4.300.0030.04616.17
5.4.290.0050.04316.24
5.4.280.0050.04316.11
5.4.270.0090.03716.08
5.4.260.0090.02316.10
5.4.250.0030.02816.26
5.4.240.0030.03516.12
5.4.230.0140.01716.17
5.4.220.0030.03716.21
5.4.210.0110.03616.19
5.4.200.0050.02516.24
5.4.190.0050.02416.16
5.4.180.0080.03816.17
5.4.170.0130.03816.12
5.4.160.0070.04216.16
5.4.150.0050.03716.20
5.4.140.0110.03214.91
5.4.130.0050.03214.88
5.4.120.0060.02714.92
5.4.110.0030.03414.89
5.4.100.0030.02514.93
5.4.90.0050.03814.93
5.4.80.0050.03914.85
5.4.70.0020.03714.93
5.4.60.0040.03714.94
5.4.50.0020.03014.85
5.4.40.0080.03314.87
5.4.30.0030.02214.80
5.4.20.0060.04014.89
5.4.10.0120.03314.91
5.4.00.0020.03014.51
5.3.290.0070.02514.02
5.3.280.0050.04014.00
5.3.270.0050.03814.03
5.3.260.0050.02714.03
5.3.250.0020.04114.00
5.3.240.0030.04214.05
5.3.230.0080.03413.98
5.3.220.0070.01714.01
5.3.210.0070.04014.00
5.3.200.0080.03914.03
5.3.190.0070.04014.01
5.3.180.0070.01813.94
5.3.170.0020.03213.95
5.3.160.0030.04013.97
5.3.150.0050.03113.99
5.3.140.0100.04013.96
5.3.130.0060.03813.96
5.3.120.0030.02713.96
5.3.110.0050.04014.00
5.3.100.0090.03713.70
5.3.90.0080.03313.67
5.3.80.0050.03813.71
5.3.70.0050.04113.69
5.3.60.0030.04113.73
5.3.50.0020.04113.68
5.3.40.0090.02013.66
5.3.30.0080.03013.65
5.3.20.0030.04013.57
5.3.10.0020.04113.54
5.3.00.0080.02013.54
5.2.170.0070.05011.30
5.2.160.0100.05311.25
5.2.150.0000.05011.18
5.2.140.0030.05011.33
5.2.130.0130.05011.29
5.2.120.0030.03311.18
5.2.110.0100.05711.21
5.2.100.0030.04711.22
5.2.90.0100.02311.21
5.2.80.0130.05311.08
5.2.70.0030.06011.25
5.2.60.0200.03711.15
5.2.50.0100.05311.17
5.2.40.0070.06011.13
5.2.30.0130.05710.88
5.2.20.0100.05311.03
5.2.10.0070.05710.81
5.2.00.0030.06010.82
5.1.60.0000.0579.88
5.1.50.0070.04310.05
5.1.40.0030.03710.01
5.1.30.0070.05710.42
5.1.20.0070.03010.52
5.1.10.0030.03710.18
5.1.00.0100.0509.96
5.0.50.0130.0378.72
5.0.40.0030.0438.48
5.0.30.0030.0678.29
5.0.20.0070.0438.29
5.0.10.0000.0408.29
5.0.00.0070.0638.29
4.4.90.0070.0308.29
4.4.80.0070.0308.29
4.4.70.0070.0338.29
4.4.60.0030.0338.29
4.4.50.0030.0308.29
4.4.40.0000.0538.29
4.4.30.0030.0278.29
4.4.20.0070.0378.29
4.4.10.0000.0378.29
4.4.00.0000.0538.29
4.3.110.0000.0378.29
4.3.100.0030.0238.29
4.3.90.0100.0108.29
4.3.80.0000.0508.29
4.3.70.0070.0308.29
4.3.60.0000.0408.29
4.3.50.0030.0378.29
4.3.40.0000.0378.29
4.3.30.0000.0378.29
4.3.20.0000.0308.29
4.3.10.0000.0408.29
4.3.00.0000.0208.29

preferences:
42.79 ms | 400 KiB | 5 Q