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 ReflectionClass($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; } }*/ var_dump($this->isDefaultValueAvailable()); if ($this->isDefaultValueAvailable() && $checkDefault) { if ($type === null) { $value = $this->getDefaultValue(); var_dump($value); $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 = null, $two = 2, $three = 'three', $empty = null, $string = 'somestring', $null = null, $int = 1, $bool = true, array $array = null, array $arrayOrNull = null, TestSampleClass $class = null, 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.0120.00918.39
8.3.50.0140.00521.99
8.3.40.0070.01018.96
8.3.30.0140.00019.05
8.3.20.0080.00020.16
8.3.10.0030.00721.92
8.3.00.0000.00822.39
8.2.180.0160.00616.75
8.2.170.0080.00822.96
8.2.160.0120.00920.84
8.2.150.0060.00324.18
8.2.140.0000.00824.66
8.2.130.0150.00626.16
8.2.120.0080.00017.75
8.2.110.0030.00621.98
8.2.100.0060.00619.76
8.2.90.0060.00319.10
8.2.80.0040.00417.97
8.2.70.0030.00617.75
8.2.60.0000.00818.05
8.2.50.0030.00618.07
8.2.40.0000.00818.34
8.2.30.0030.00518.18
8.2.20.0080.00017.82
8.2.10.0080.00019.65
8.2.00.0080.00017.71
8.1.280.0070.00725.92
8.1.270.0060.00322.05
8.1.260.0060.00326.35
8.1.250.0000.00828.09
8.1.240.0060.00323.90
8.1.230.0080.00419.16
8.1.220.0000.00817.74
8.1.210.0000.00818.77
8.1.200.0090.00017.22
8.1.190.0000.00817.43
8.1.180.0040.00418.63
8.1.170.0030.00618.71
8.1.160.0000.00821.95
8.1.150.0000.00818.70
8.1.140.0040.00417.48
8.1.130.0030.00617.70
8.1.120.0040.00417.48
8.1.110.0030.00617.46
8.1.100.0040.00417.48
8.1.90.0040.00417.51
8.1.80.0080.00017.41
8.1.70.0040.00417.52
8.1.60.0050.00317.63
8.1.50.0000.00817.57
8.1.40.0030.00617.49
8.1.30.0040.00417.66
8.1.20.0030.00517.75
8.1.10.0000.00717.61
8.1.00.0020.00517.56
8.0.300.0000.00718.77
8.0.290.0040.00417.05
8.0.280.0000.00718.48
8.0.270.0070.00017.23
8.0.260.0030.00316.92
8.0.250.0000.00716.99
8.0.240.0000.00717.11
8.0.230.0070.00017.06
8.0.220.0020.00516.93
8.0.210.0000.00816.85
8.0.200.0030.00316.94
8.0.190.0060.00317.01
8.0.180.0070.00016.97
8.0.170.0000.00816.98
8.0.160.0000.00817.00
8.0.150.0000.00716.91
8.0.140.0050.00316.98
8.0.130.0000.00613.41
8.0.120.0050.00316.93
8.0.110.0030.00616.88
8.0.100.0000.00716.82
8.0.90.0050.00316.81
8.0.80.0060.01416.98
8.0.70.0080.00017.01
8.0.60.0000.00816.99
8.0.50.0050.00216.89
8.0.30.0120.01017.19
8.0.20.0060.01317.40
8.0.10.0080.00017.02
8.0.00.0080.01016.88
7.4.330.0000.00515.00
7.4.320.0030.00316.46
7.4.300.0030.00316.62
7.4.290.0080.00016.54
7.4.280.0050.00316.52
7.4.270.0030.00316.64
7.4.260.0040.00416.66
7.4.250.0050.00316.52
7.4.240.0030.00516.50
7.4.230.0000.00716.52
7.4.220.0140.01016.70
7.4.210.0060.01116.55
7.4.200.0030.00316.65
7.4.190.0000.00716.76
7.4.160.0090.00616.60
7.4.150.0140.00317.40
7.4.140.0130.00817.86
7.4.130.0090.00916.69
7.4.120.0070.01016.46
7.4.110.0100.01016.46
7.4.100.0130.01316.42
7.4.90.0130.00616.41
7.4.80.0170.00319.39
7.4.70.0120.00816.61
7.4.60.0060.01216.53
7.4.50.0000.00816.44
7.4.40.0100.00522.77
7.4.30.0000.01616.55
7.4.10.0070.01116.40
7.4.00.0040.01315.82
7.3.330.0000.00513.39
7.3.320.0060.00013.36
7.3.310.0040.00416.39
7.3.300.0040.00416.27
7.3.290.0090.00916.38
7.3.280.0070.01216.41
7.3.270.0120.00617.40
7.3.260.0140.00416.55
7.3.250.0080.00916.61
7.3.240.0030.01816.50
7.3.230.0030.01516.43
7.3.210.0000.01616.43
7.3.200.0070.01019.39
7.3.190.0080.01016.46
7.3.180.0030.01216.19
7.3.170.0110.01216.57
7.3.160.0030.01416.59
7.3.130.0000.01816.30
7.3.120.0040.01315.50
7.3.110.0040.01116.50
7.3.100.0070.00716.40
7.3.90.0030.00716.56
7.3.80.0000.01416.38
7.3.70.0030.01316.41
7.3.60.0060.00616.29
7.3.50.0050.01016.39
7.3.40.0030.01216.50
7.3.30.0060.00916.30
7.3.20.0030.00918.21
7.3.10.0090.00918.29
7.3.00.0070.01318.23
7.2.330.0110.00816.76
7.2.320.0070.01116.93
7.2.310.0030.01316.56
7.2.300.0170.00416.83
7.2.290.0120.00616.85
7.2.260.0090.00916.43
7.2.250.0030.01716.62
7.2.240.0090.00616.50
7.2.230.0060.00916.76
7.2.220.0000.01416.53
7.2.210.0090.00616.59
7.2.200.0070.01116.63
7.2.190.0120.00316.72
7.2.180.0070.01316.50
7.2.170.0020.01316.69
7.2.160.0130.00616.56
7.2.150.0030.01318.54
7.2.140.0100.00618.38
7.2.130.0050.01418.45
7.2.120.0030.01018.46
7.2.110.0080.00818.65
7.2.100.0100.00018.27
7.2.90.0070.00718.42
7.2.80.0070.01018.42
7.2.70.0030.00818.50
7.2.60.0060.00618.35
7.2.50.0130.00318.53
7.2.40.0070.00718.54
7.2.30.0060.00918.64
7.2.20.0070.00718.38
7.2.10.0090.00618.60
7.2.00.0030.00718.39
7.1.330.0090.00317.50
7.1.320.0040.00817.49
7.1.310.0040.01117.30
7.1.300.0110.00717.24
7.1.290.0080.00817.46
7.1.280.0040.01517.37
7.1.270.0030.01017.52
7.1.260.0040.01117.12
7.1.250.0110.00417.22
7.1.240.0070.01017.41
7.1.230.0070.00317.49
7.1.220.0070.00417.38
7.1.210.0110.00317.25
7.1.200.0110.00417.35
7.1.190.0100.00017.41
7.1.180.0040.01117.34
7.1.170.0040.01117.30
7.1.160.0070.00717.25
7.1.150.0120.00317.31
7.1.140.0100.00017.44
7.1.130.0040.01117.25
7.1.120.0000.01517.44
7.1.110.0040.01117.26
7.1.100.0060.00317.48
7.1.90.0060.01017.09
7.1.80.0040.00717.43
7.1.70.0040.00417.15
7.1.60.0100.01018.62
7.1.50.0030.00817.20
7.1.40.0030.00617.51
7.1.30.0120.00617.50
7.1.20.0090.00917.19
7.1.10.0080.00817.19
7.1.00.0030.04219.82
7.0.330.0070.01117.13
7.0.320.0040.00817.26
7.0.310.0030.00916.98
7.0.300.0030.00717.00
7.0.290.0030.01317.11
7.0.280.0070.00717.11
7.0.270.0070.00417.09
7.0.260.0030.01016.99
7.0.250.0090.00317.18
7.0.240.0130.00316.84
7.0.230.0000.00917.25
7.0.220.0000.00816.88
7.0.210.0030.00617.07
7.0.200.0110.00517.00
7.0.190.0000.01017.05
7.0.180.0070.00717.03
7.0.170.0150.00016.97
7.0.160.0070.00417.18
7.0.150.0090.00617.11
7.0.140.0080.03519.67
7.0.130.0030.01017.13
7.0.120.0100.00717.15
7.0.110.0030.00917.14
7.0.100.0060.02818.62
7.0.90.0070.04518.54
7.0.80.0070.04218.55
7.0.70.0070.02718.49
7.0.60.0080.04218.42
7.0.50.0090.04218.61
7.0.40.0120.02517.59
7.0.30.0070.04217.54
7.0.20.0110.04117.50
7.0.10.0110.03817.58
7.0.00.0080.04517.48
5.6.400.0140.00716.14
5.6.390.0000.01316.21
5.6.380.0070.00716.12
5.6.370.0030.01016.27
5.6.360.0000.01415.80
5.6.350.0040.00715.67
5.6.340.0030.00716.21
5.6.330.0060.00916.11
5.6.320.0030.00715.71
5.6.310.0050.00516.10
5.6.300.0100.00316.20
5.6.290.0070.00315.80
5.6.280.0100.03618.51
5.6.270.0040.01515.89
5.6.260.0000.01816.30
5.6.250.0070.04318.23
5.6.240.0080.04518.28
5.6.230.0030.04718.37
5.6.220.0050.02718.27
5.6.210.0030.04618.37
5.6.200.0050.03418.55
5.6.190.0050.03518.52
5.6.180.0100.03218.46
5.6.170.0020.04318.44
5.6.160.0080.04118.54
5.6.150.0070.02818.63
5.6.140.0100.04018.52
5.6.130.0130.04218.64
5.6.120.0030.04918.60
5.6.110.0070.02518.48
5.6.100.0050.03118.47
5.6.90.0070.04218.57
5.6.80.0050.04718.24
5.6.70.0060.03518.04
5.6.60.0050.04518.14
5.6.50.0130.03718.27
5.6.40.0110.04118.15
5.6.30.0100.02318.21
5.6.20.0100.02318.28
5.6.10.0090.03718.24
5.6.00.0050.04118.24
5.5.380.0050.02718.24
5.5.370.0030.02518.13
5.5.360.0070.04318.26
5.5.350.0030.04718.28
5.5.340.0050.03518.39
5.5.330.0070.04118.48
5.5.320.0050.04118.36
5.5.310.0110.03818.38
5.5.300.0100.04218.49
5.5.290.0050.04818.54
5.5.280.0050.04618.38
5.5.270.0040.04518.31
5.5.260.0080.03818.46
5.5.250.0090.03418.23
5.5.240.0110.04118.06
5.5.230.0070.03117.99
5.5.220.0070.03317.90
5.5.210.0020.03218.04
5.5.200.0110.03518.09
5.5.190.0100.04317.88
5.5.180.0020.04718.11
5.5.170.0070.01016.07
5.5.160.0050.04118.10
5.5.150.0120.02218.03
5.5.140.0100.01818.08
5.5.130.0080.03817.97
5.5.120.0050.04318.07
5.5.110.0070.02818.02
5.5.100.0050.04117.95
5.5.90.0080.04017.85
5.5.80.0090.04018.06
5.5.70.0070.04217.93
5.5.60.0030.04418.05
5.5.50.0100.04017.84
5.5.40.0050.04517.96
5.5.30.0080.04117.99
5.5.20.0080.03917.95
5.5.10.0080.04018.01
5.5.00.0070.02617.86
5.4.450.0070.02716.07
5.4.440.0060.04316.03
5.4.430.0070.03216.07
5.4.420.0040.03416.07
5.4.410.0100.03516.02
5.4.400.0080.03815.81
5.4.390.0080.04015.65
5.4.380.0000.03015.89
5.4.370.0070.04015.87
5.4.360.0050.04515.96
5.4.350.0010.02815.77
5.4.340.0100.04015.84
5.4.330.0120.00012.93
5.4.320.0030.03415.84
5.4.310.0050.03816.00
5.4.300.0070.02215.80
5.4.290.0100.01815.71
5.4.280.0050.03615.73
5.4.270.0060.02315.80
5.4.260.0060.04015.99
5.4.250.0020.03815.83
5.4.240.0070.03915.77
5.4.230.0050.04015.89
5.4.220.0060.02315.93
5.4.210.0050.02415.95
5.4.200.0040.04415.92
5.4.190.0110.03615.91
5.4.180.0050.04015.93
5.4.170.0050.03915.82
5.4.160.0070.03515.87
5.4.150.0050.04315.86
5.4.140.0000.04314.50
5.4.130.0070.03814.37
5.4.120.0060.04014.46
5.4.110.0020.03414.50
5.4.100.0050.03714.42
5.4.90.0060.04014.66
5.4.80.0100.03714.36
5.4.70.0000.03114.65
5.4.60.0030.04014.59
5.4.50.0080.02614.48
5.4.40.0080.02314.64
5.4.30.0050.03214.50
5.4.20.0100.02114.62
5.4.10.0000.03214.51
5.4.00.0000.02614.29
5.3.290.0080.02313.93
5.3.280.0060.02613.88
5.3.270.0070.04213.96
5.3.260.0070.03813.79
5.3.250.0100.03813.87
5.3.240.0020.04113.88
5.3.230.0100.03613.89
5.3.220.0070.02713.75
5.3.210.0030.05013.79
5.3.200.0080.03813.83
5.3.190.0130.03514.04
5.3.180.0100.02013.96
5.3.170.0070.04413.95
5.3.160.0100.02314.04
5.3.150.0050.04213.88
5.3.140.0100.03013.90
5.3.130.0080.03213.86
5.3.120.0120.03313.92
5.3.110.0030.04213.81
5.3.100.0080.04013.65
5.3.90.0080.01813.57
5.3.80.0070.03713.52
5.3.70.0070.04513.59
5.3.60.0050.03013.53
5.3.50.0050.02913.46
5.3.40.0050.04013.49
5.3.30.0050.03513.42
5.3.20.0020.03813.44
5.3.10.0050.04013.20
5.3.00.0060.03213.28
5.2.170.0070.06012.23
5.2.160.0030.05312.23
5.2.150.0000.04012.23
5.2.140.0070.05312.23
5.2.130.0070.03312.23
5.2.120.0030.05012.23
5.2.110.0070.05312.23
5.2.100.0070.06312.23
5.2.90.0030.05312.23
5.2.80.0030.06312.23
5.2.70.0030.03012.23
5.2.60.0100.04312.23
5.2.50.0030.05012.23
5.2.40.0130.04712.23
5.2.30.0100.06012.23
5.2.20.0030.05312.23
5.2.10.0070.05312.23
5.2.00.0100.05312.23
5.1.60.0000.05312.23
5.1.50.0000.05712.23
5.1.40.0030.03012.23
5.1.30.0030.04712.23
5.1.20.0000.06012.23
5.1.10.0000.02712.23
5.1.00.0000.04012.23
5.0.50.0030.02312.23
5.0.40.0000.04012.23
5.0.30.0030.05012.23
5.0.20.0000.04012.23
5.0.10.0070.02712.23
5.0.00.0030.06012.23
4.4.90.0000.03012.23
4.4.80.0000.01712.23
4.4.70.0030.02312.23
4.4.60.0000.02712.23
4.4.50.0070.02312.23
4.4.40.0030.04712.23
4.4.30.0030.01312.23
4.4.20.0030.03012.23
4.4.10.0000.01712.23
4.4.00.0000.02312.23
4.3.110.0070.03012.23
4.3.100.0030.01312.23
4.3.90.0000.03712.23
4.3.80.0030.05012.23
4.3.70.0000.02712.23
4.3.60.0000.03012.23
4.3.50.0030.03312.23
4.3.40.0000.05312.23
4.3.30.0030.03312.23
4.3.20.0000.03312.23
4.3.10.0000.01712.23
4.3.00.0000.02012.23

preferences:
49.15 ms | 401 KiB | 5 Q