3v4l.org

run code in 300+ PHP versions simultaneously
<?php class TestSampleClass { } class ParameterReflection extends ReflectionParameter { protected $isFromMethod = false; public function getDeclaringClass() { $phpReflection = parent::getDeclaringClass(); $zendReflection = new ReflectionClass($phpReflection->getName()); unset($phpReflection); return $zendReflection; } public function getClass() { $phpReflection = parent::getClass(); if ($phpReflection == null) { return null; } $zendReflection = new ClassReflection($phpReflection->getName()); unset($phpReflection); return $zendReflection; } 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; } 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; } } class TestSampleClass5 { /** * @param int $one Description for one * @param int Description for two * @param string $three Description for three * which spans multiple lines */ 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'; } } $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.60.0150.00018.28
8.3.50.0150.00322.13
8.3.40.0110.00718.92
8.3.30.0040.01119.22
8.3.20.0080.00020.10
8.3.10.0080.00022.10
8.3.00.0040.00422.57
8.2.180.0060.01316.88
8.2.170.0070.00722.96
8.2.160.0100.00720.89
8.2.150.0000.00824.18
8.2.140.0080.00024.66
8.2.130.0080.00026.16
8.2.120.0040.00419.61
8.2.110.0060.00322.08
8.2.100.0120.00019.63
8.2.90.0000.00819.17
8.2.80.0080.00318.16
8.2.70.0060.00317.63
8.2.60.0030.00517.93
8.2.50.0000.00918.07
8.2.40.0000.00818.34
8.2.30.0000.01018.21
8.2.20.0000.00817.70
8.2.10.0040.00417.83
8.2.00.0030.00617.90
8.1.280.0100.00325.92
8.1.270.0050.00322.20
8.1.260.0130.00626.35
8.1.250.0040.01128.09
8.1.240.0060.00323.98
8.1.230.0100.00318.95
8.1.220.0040.00417.74
8.1.210.0050.00318.77
8.1.200.0030.00617.35
8.1.190.0080.00017.52
8.1.180.0050.00318.10
8.1.170.0000.00818.42
8.1.160.0030.00621.96
8.1.150.0050.00518.59
8.1.140.0080.00017.48
8.1.130.0070.00017.96
8.1.120.0050.00317.58
8.1.110.0080.00017.50
8.1.100.0040.00417.46
8.1.90.0000.00717.51
8.1.80.0050.00317.39
8.1.70.0040.00417.48
8.1.60.0040.00517.65
8.1.50.0000.00817.55
8.1.40.0040.00417.53
8.1.30.0040.00417.66
8.1.20.0060.00317.59
8.1.10.0040.00417.47
8.1.00.0080.00017.43
8.0.300.0030.00518.77
8.0.290.0000.00717.05
8.0.280.0050.00318.44
8.0.270.0000.00717.23
8.0.260.0000.00716.79
8.0.250.0040.00417.04
8.0.240.0080.00017.05
8.0.230.0040.00417.11
8.0.220.0000.00716.91
8.0.210.0040.00416.89
8.0.200.0000.00717.06
8.0.190.0040.00417.06
8.0.180.0090.00016.97
8.0.170.0040.00417.05
8.0.160.0000.00816.98
8.0.150.0000.00716.95
8.0.140.0000.00716.89
8.0.130.0030.00313.46
8.0.120.0060.00317.00
8.0.110.0040.00417.04
8.0.100.0000.00817.00
8.0.90.0000.00816.95
8.0.80.0030.01216.96
8.0.70.0030.00516.99
8.0.60.0080.00017.05
8.0.50.0040.00416.82
8.0.30.0130.01517.24
8.0.20.0110.01117.40
8.0.10.0000.00817.06
8.0.00.0030.01516.80
7.4.330.0050.00015.20
7.4.320.0000.00616.43
7.4.300.0000.00716.43
7.4.290.0000.00716.52
7.4.280.0070.00016.66
7.4.270.0050.00216.52
7.4.260.0030.00316.51
7.4.250.0050.00316.57
7.4.240.0040.00316.58
7.4.230.0040.00416.70
7.4.220.0100.00616.72
7.4.210.0070.01116.55
7.4.200.0020.00516.52
7.4.190.0030.00516.71
7.4.160.0090.00616.56
7.4.150.0090.00917.40
7.4.140.0150.00717.86
7.4.130.0050.01316.56
7.4.120.0110.00916.51
7.4.110.0200.00316.55
7.4.100.0070.01116.64
7.4.90.0060.01116.62
7.4.80.0150.00316.57
7.4.70.0040.01516.43
7.4.60.0030.01216.55
7.4.50.0040.00416.71
7.4.40.0060.01022.77
7.4.30.0060.01016.55
7.4.10.0070.01016.60
7.4.00.0130.00515.89
7.3.330.0000.00513.22
7.3.320.0000.00513.46
7.3.310.0040.00416.35
7.3.300.0070.00016.29
7.3.290.0130.00316.47
7.3.280.0120.00616.43
7.3.270.0090.01217.40
7.3.260.0040.01516.63
7.3.250.0090.00916.55
7.3.240.0070.01016.61
7.3.230.0070.01116.68
7.3.210.0090.00916.41
7.3.200.0140.00819.39
7.3.190.0120.00616.55
7.3.180.0090.00816.39
7.3.170.0130.01016.39
7.3.160.0000.01716.46
7.3.130.0130.00616.38
7.3.120.0030.01315.60
7.3.110.0120.00616.55
7.3.100.0080.00416.52
7.3.90.0030.01016.29
7.3.80.0040.00816.53
7.3.70.0000.01016.34
7.3.60.0070.00716.33
7.3.50.0060.00616.34
7.3.40.0060.00916.41
7.3.30.0000.01616.39
7.3.20.0060.00918.14
7.3.10.0080.00717.48
7.3.00.0080.00717.22
7.2.330.0190.00616.47
7.2.320.0070.01416.75
7.2.310.0160.00516.81
7.2.300.0090.00916.91
7.2.290.0170.00016.79
7.2.260.0090.01216.77
7.2.250.0090.00916.93
7.2.240.0000.01716.77
7.2.230.0080.01116.85
7.2.220.0040.01116.84
7.2.210.0090.00616.87
7.2.200.0040.01116.67
7.2.190.0000.01516.59
7.2.180.0030.01016.55
7.2.170.0030.00816.61
7.2.160.0100.01016.77
7.2.150.0150.00018.54
7.2.140.0040.01118.61
7.2.130.0100.00717.60
7.2.120.0020.01217.55
7.2.110.0080.00817.61
7.2.100.0070.00517.64
7.2.90.0050.00917.70
7.2.80.0080.00917.63
7.2.70.0070.00317.81
7.2.60.0080.00717.41
7.2.50.0060.00917.35
7.2.40.0050.00817.77
7.2.30.0030.01117.68
7.2.20.0050.01117.63
7.2.10.0050.00917.65
7.2.00.0090.00518.22
7.1.330.0060.00617.36
7.1.320.0070.01017.59
7.1.310.0070.01117.42
7.1.300.0000.01217.41
7.1.290.0060.00317.44
7.1.280.0070.00717.53
7.1.270.0000.01517.19
7.1.260.0040.00817.31
7.1.250.0080.00716.61
7.1.240.0060.00917.38
7.1.230.0090.00617.24
7.1.220.0100.00317.29
7.1.210.0060.00917.54
7.1.200.0070.00716.50
7.1.190.0040.00917.28
7.1.180.0090.00617.36
7.1.170.0060.00917.17
7.1.160.0040.01217.41
7.1.150.0040.01117.38
7.1.140.0000.01517.39
7.1.130.0040.01117.30
7.1.120.0030.01417.45
7.1.110.0030.01517.34
7.1.100.0030.01217.75
7.1.90.0090.00617.33
7.1.80.0120.00417.24
7.1.70.0080.00517.30
7.1.60.0060.01418.55
7.1.50.0040.01116.99
7.1.40.0030.00717.41
7.1.30.0110.00417.30
7.1.20.0030.01017.47
7.1.10.0040.00717.42
7.1.00.0030.04319.93
7.0.330.0100.00717.10
7.0.320.0030.01317.00
7.0.310.0000.01516.82
7.0.300.0080.00317.31
7.0.290.0040.01117.16
7.0.280.0030.00617.04
7.0.270.0060.01016.88
7.0.260.0070.01017.15
7.0.250.0090.00916.99
7.0.240.0040.01117.08
7.0.230.0030.00617.09
7.0.220.0130.00317.04
7.0.210.0100.00016.97
7.0.200.0080.00516.88
7.0.190.0080.00517.00
7.0.180.0040.00717.09
7.0.170.0090.00616.99
7.0.160.0060.00917.02
7.0.150.0040.01116.98
7.0.140.0030.04219.52
7.0.130.0030.01016.95
7.0.120.0060.00616.92
7.0.110.0130.00316.95
7.0.100.0090.00616.92
7.0.90.0090.00617.10
7.0.80.0290.03718.52
7.0.70.0250.04018.47
7.0.60.0280.03018.61
7.0.50.0310.02118.71
7.0.40.0080.04717.61
7.0.30.0060.02517.53
7.0.20.0040.03917.48
7.0.10.0050.04017.52
7.0.00.0130.04117.50
5.6.400.0070.00716.18
5.6.390.0090.00316.32
5.6.380.0040.01115.86
5.6.370.0070.00316.23
5.6.360.0090.00615.88
5.6.350.0000.01716.07
5.6.340.0000.01015.98
5.6.330.0030.00715.88
5.6.320.0000.01415.96
5.6.310.0000.01516.13
5.6.300.0070.00716.07
5.6.290.0000.01415.69
5.6.280.0050.05118.49
5.6.270.0030.00715.87
5.6.260.0030.01315.96
5.6.250.0060.00616.07
5.6.240.0070.01016.06
5.6.230.0080.02318.34
5.6.220.0090.03618.33
5.6.210.0070.04518.26
5.6.200.0080.02618.60
5.6.190.0070.02618.58
5.6.180.0110.03518.59
5.6.170.0070.03018.47
5.6.160.0100.02518.53
5.6.150.0020.04918.43
5.6.140.0060.04318.69
5.6.130.0070.04718.56
5.6.120.0050.03418.51
5.6.110.0050.04518.52
5.6.100.0070.04218.54
5.6.90.0050.04818.56
5.6.80.0030.04318.18
5.6.70.0090.04118.15
5.6.60.0050.04618.33
5.6.50.0090.03818.10
5.6.40.0060.04518.32
5.6.30.0070.03218.11
5.6.20.0070.02718.10
5.6.10.0130.04218.32
5.6.00.0100.02718.14
5.5.380.0130.00716.06
5.5.370.0090.02418.10
5.5.360.0100.02818.16
5.5.350.0070.04918.27
5.5.340.0030.04718.49
5.5.330.0030.05218.53
5.5.320.0050.04618.30
5.5.310.0150.03818.33
5.5.300.0050.03318.44
5.5.290.0070.02818.45
5.5.280.0050.03218.54
5.5.270.0060.03018.22
5.5.260.0040.03918.36
5.5.250.0080.02118.21
5.5.240.0080.02718.05
5.5.230.0050.04518.00
5.5.220.0070.03717.93
5.5.210.0100.02518.02
5.5.200.0030.04418.00
5.5.190.0030.03918.04
5.5.180.0050.04318.13
5.5.170.0050.00615.87
5.5.160.0070.03917.85
5.5.150.0070.04018.09
5.5.140.0030.03118.08
5.5.130.0050.03118.02
5.5.120.0070.04118.00
5.5.110.0120.04018.14
5.5.100.0090.04017.78
5.5.90.0080.04218.06
5.5.80.0050.04318.01
5.5.70.0070.04317.88
5.5.60.0080.04118.07
5.5.50.0070.02518.01
5.5.40.0060.04317.99
5.5.30.0090.03517.94
5.5.20.0090.03318.01
5.5.10.0020.03017.90
5.5.00.0050.04217.96
5.4.450.0050.02316.04
5.4.440.0050.04316.16
5.4.430.0030.02616.05
5.4.420.0050.04816.11
5.4.410.0040.02715.96
5.4.400.0050.02315.88
5.4.390.0050.04215.80
5.4.380.0090.02515.99
5.4.370.0100.01715.95
5.4.360.0080.04015.93
5.4.350.0110.02015.87
5.4.340.0070.03616.04
5.4.330.0070.00312.56
5.4.320.0050.03815.78
5.4.310.0070.02715.93
5.4.300.0070.02715.77
5.4.290.0030.02415.81
5.4.280.0110.03315.80
5.4.270.0070.03715.84
5.4.260.0120.03615.95
5.4.250.0030.04515.92
5.4.240.0020.03715.89
5.4.230.0130.03315.87
5.4.220.0080.02215.84
5.4.210.0030.02815.75
5.4.200.0050.02515.78
5.4.190.0020.02515.98
5.4.180.0060.02016.01
5.4.170.0030.02715.79
5.4.160.0030.04515.78
5.4.150.0070.04115.91
5.4.140.0030.03214.49
5.4.130.0040.03114.62
5.4.120.0000.02414.54
5.4.110.0050.03414.61
5.4.100.0020.02714.62
5.4.90.0020.03314.76
5.4.80.0100.03514.60
5.4.70.0000.04914.55
5.4.60.0050.04014.59
5.4.50.0040.04014.49
5.4.40.0030.02314.68
5.4.30.0030.02714.53
5.4.20.0050.02214.62
5.4.10.0020.02014.51
5.4.00.0030.02214.22
5.3.290.0100.02513.97
5.3.280.0000.04413.85
5.3.270.0050.03613.96
5.3.260.0020.02913.99
5.3.250.0050.03614.08
5.3.240.0020.04413.88
5.3.230.0030.02213.87
5.3.220.0070.03913.86
5.3.210.0100.03813.87
5.3.200.0020.04213.74
5.3.190.0070.03113.86
5.3.180.0030.04013.94
5.3.170.0070.04013.98
5.3.160.0070.02513.96
5.3.150.0080.02113.90
5.3.140.0100.03513.93
5.3.130.0020.02513.96
5.3.120.0080.01813.88
5.3.110.0100.01713.92
5.3.100.0030.02113.77
5.3.90.0030.02213.59
5.3.80.0020.02513.45
5.3.70.0080.01813.53
5.3.60.0060.02013.56
5.3.50.0020.02513.58
5.3.40.0020.03513.58
5.3.30.0030.02013.57
5.3.20.0030.03313.39
5.3.10.0080.02513.32
5.3.00.0030.02013.31
5.2.170.0000.03013.53
5.2.160.0030.04313.53
5.2.150.0070.02713.53
5.2.140.0070.02013.53
5.2.130.0030.02313.53
5.2.120.0000.02713.53
5.2.110.0030.02313.53
5.2.100.0030.02713.53
5.2.90.0070.05013.53
5.2.80.0000.03013.53
5.2.70.0000.02713.53
5.2.60.0030.03013.53
5.2.50.0000.03013.53
5.2.40.0030.02713.53
5.2.30.0100.02013.53
5.2.20.0000.02713.53
5.2.10.0000.03313.53
5.2.00.0070.02713.53
5.1.60.0000.02013.53
5.1.50.0000.02713.53
5.1.40.0000.02313.53
5.1.30.0070.02313.53
5.1.20.0000.03013.53
5.1.10.0000.02313.53
5.1.00.0030.02313.53
5.0.50.0000.02013.53
5.0.40.0000.02013.53
5.0.30.0030.03013.53
5.0.20.0000.01713.53
5.0.10.0000.01713.53
5.0.00.0030.03013.53
4.4.90.0000.02013.53
4.4.80.0000.02313.53
4.4.70.0030.01313.53
4.4.60.0000.01713.53
4.4.50.0000.01313.53
4.4.40.0030.02013.53
4.4.30.0030.01013.53
4.4.20.0030.01313.53
4.4.10.0030.01313.53
4.4.00.0000.02713.53
4.3.110.0000.01713.53
4.3.100.0000.01313.53
4.3.90.0000.01713.53
4.3.80.0000.02013.53
4.3.70.0000.01313.53
4.3.60.0030.01013.53
4.3.50.0000.01713.53
4.3.40.0000.02013.53
4.3.30.0000.02013.53
4.3.20.0000.01713.53
4.3.10.0000.01713.53
4.3.00.0030.01013.53

preferences:
42.77 ms | 401 KiB | 5 Q