3v4l.org

run code in 300+ PHP versions simultaneously
<?php class TestSampleClass { } class MethodReflection extends ReflectionMethod { protected $annotations = null; public function getDocBlock() { if ('' == $this->getDocComment()) { return false; } $instance = new DocBlockReflection($this); return $instance; } public function getAnnotations(AnnotationManager $annotationManager) { if (($docComment = $this->getDocComment()) == '') { return false; } if (!$this->annotations) { $cachingFileScanner = new CachingFileScanner($this->getFileName()); $nameInformation = $cachingFileScanner->getClassNameInformation($this->getDeclaringClass()->getName()); $this->annotations = new AnnotationScanner($annotationManager, $docComment, $nameInformation); } return $this->annotations; } public function getDeclaringClass() { $phpReflection = parent::getDeclaringClass(); $zendReflection = new ClassReflection($phpReflection->getName()); unset($phpReflection); return $zendReflection; } public function getParameters() { $phpReflections = parent::getParameters(); $zendReflections = array(); while ($phpReflections && ($phpReflection = array_shift($phpReflections))) { $instance = new ParameterReflection(array($this->getDeclaringClass()->getName(), $this->getName()), $phpReflection->getName()); $zendReflections[] = $instance; unset($phpReflection); } unset($phpReflections); return $zendReflections; } } 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 MethodReflection($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.0130.01018.20
8.3.50.0070.01221.93
8.3.40.0110.00418.89
8.3.30.0180.00018.96
8.3.20.0040.00418.95
8.3.10.0040.00421.27
8.3.00.0040.00421.79
8.2.180.0040.01816.63
8.2.170.0090.00622.96
8.2.160.0070.00720.39
8.2.150.0080.00024.18
8.2.140.0000.00824.66
8.2.130.0000.00826.16
8.2.120.0050.00319.48
8.2.110.0040.00720.52
8.2.100.0000.01017.66
8.2.90.0000.00819.36
8.2.80.0080.00018.05
8.2.70.0030.00617.63
8.2.60.0000.00817.93
8.2.50.0030.00518.07
8.2.40.0000.00918.33
8.2.30.0050.00319.96
8.2.20.0060.00317.85
8.2.10.0000.00817.93
8.2.00.0000.00817.86
8.1.280.0100.01025.92
8.1.270.0040.00423.99
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0090.00022.65
8.1.230.0110.00020.98
8.1.220.0050.00518.77
8.1.210.0040.00418.93
8.1.200.0060.00317.48
8.1.190.0040.00417.65
8.1.180.0050.00318.10
8.1.170.0030.00618.54
8.1.160.0000.00718.95
8.1.150.0080.00018.61
8.1.140.0000.00917.45
8.1.130.0000.00717.82
8.1.120.0000.00717.49
8.1.110.0110.00017.54
8.1.100.0050.00317.50
8.1.90.0040.00417.54
8.1.80.0040.00417.54
8.1.70.0080.00017.40
8.1.60.0030.00617.66
8.1.50.0090.00017.43
8.1.40.0040.00417.48
8.1.30.0080.00017.77
8.1.20.0000.00817.65
8.1.10.0030.00517.64
8.1.00.0040.00717.45
8.0.300.0000.00819.97
8.0.290.0040.00417.18
8.0.280.0040.00418.50
8.0.270.0030.00317.20
8.0.260.0050.00216.85
8.0.250.0060.00317.02
8.0.240.0060.00317.11
8.0.230.0030.00317.11
8.0.220.0040.00417.05
8.0.210.0080.00016.91
8.0.200.0000.00717.16
8.0.190.0050.00316.99
8.0.180.0050.00316.94
8.0.170.0000.00817.11
8.0.160.0000.00717.01
8.0.150.0000.00816.85
8.0.140.0000.00716.97
8.0.130.0000.00613.46
8.0.120.0050.00316.87
8.0.110.0050.00316.90
8.0.100.0040.00416.89
8.0.90.0000.00816.95
8.0.80.0060.00917.06
8.0.70.0070.00016.90
8.0.60.0050.00316.93
8.0.50.0030.00616.86
8.0.30.0080.01117.10
8.0.20.0110.01017.40
8.0.10.0000.00717.04
8.0.00.0090.01116.89
7.4.330.0050.00014.71
7.4.320.0070.00016.57
7.4.300.0030.00316.54
7.4.290.0000.00916.69
7.4.280.0000.00816.67
7.4.270.0000.00716.61
7.4.260.0050.00013.26
7.4.250.0000.00816.58
7.4.240.0040.00416.64
7.4.230.0040.00416.74
7.4.220.0100.01416.61
7.4.210.0090.00716.61
7.4.200.0050.00316.76
7.4.190.0030.00616.61
7.4.160.0040.01216.34
7.4.150.0060.01217.40
7.4.140.0150.01117.86
7.4.130.0030.01416.58
7.4.120.0080.01016.62
7.4.110.0060.01516.63
7.4.100.0040.01216.45
7.4.90.0030.02116.64
7.4.80.0180.00419.37
7.4.70.0090.00916.68
7.4.60.0140.00316.64
7.4.50.0040.00416.63
7.4.40.0060.00922.27
7.4.30.0130.00616.64
7.4.00.0110.00415.13
7.3.330.0030.00313.53
7.3.320.0050.00013.40
7.3.310.0000.00716.47
7.3.300.0040.00416.39
7.3.290.0090.01216.35
7.3.280.0080.01116.46
7.3.270.0120.00617.40
7.3.260.0140.00718.24
7.3.250.0100.01116.41
7.3.240.0080.00816.53
7.3.230.0040.01316.55
7.3.210.0170.00716.48
7.3.200.0130.00619.39
7.3.190.0090.00916.48
7.3.180.0080.00816.56
7.3.170.0060.01016.52
7.3.160.0090.00916.54
7.3.120.0110.00615.04
7.3.110.0100.01014.95
7.3.100.0090.00614.69
7.3.90.0000.01315.05
7.3.80.0000.01314.92
7.3.70.0060.00614.89
7.3.60.0030.01014.94
7.3.50.0030.00614.73
7.3.40.0080.00414.94
7.3.30.0060.00614.92
7.3.20.0090.00616.83
7.3.10.0060.00816.56
7.3.00.0030.00916.38
7.2.330.0080.01216.80
7.2.320.0110.00616.79
7.2.310.0130.01016.88
7.2.300.0150.00316.71
7.2.290.0140.01016.93
7.2.240.0090.00915.05
7.2.230.0030.01415.14
7.2.220.0000.01115.27
7.2.210.0070.01115.03
7.2.200.0040.01514.94
7.2.190.0040.00914.95
7.2.180.0080.00415.18
7.2.170.0060.00615.17
7.2.160.0060.00315.05
7.2.150.0030.01117.05
7.2.140.0060.00917.04
7.2.130.0060.00916.66
7.2.120.0030.01216.74
7.2.110.0110.00616.67
7.2.100.0030.01016.86
7.2.90.0000.01216.76
7.2.80.0060.00916.94
7.2.70.0130.00316.86
7.2.60.0080.00716.77
7.2.50.0030.01417.05
7.2.40.0060.00917.04
7.2.30.0040.01117.01
7.2.20.0060.01216.73
7.2.10.0060.00616.80
7.2.00.0050.00817.98
7.1.330.0110.00715.86
7.1.320.0050.00515.95
7.1.310.0040.01515.95
7.1.300.0120.00015.89
7.1.290.0030.00615.95
7.1.280.0030.01016.00
7.1.270.0080.00415.62
7.1.260.0030.00515.71
7.1.250.0000.01115.65
7.1.200.0060.00315.96
7.1.100.0090.00918.07
7.1.70.0070.01117.14
7.1.60.0100.01419.40
7.1.50.0070.01716.93
7.1.00.0130.06322.24
7.0.200.0030.00616.50
7.0.140.0000.08022.11
7.0.110.0130.07020.14
7.0.100.0070.06020.16
7.0.90.0100.07720.03
7.0.80.0000.06320.12
7.0.70.0000.04319.98
7.0.60.0000.04320.09
7.0.50.0070.08320.18
7.0.40.0100.07319.64
7.0.30.0000.08719.78
7.0.20.0000.04319.84
7.0.10.0070.06719.80
7.0.00.0030.05719.75
5.6.280.0130.06320.96
5.6.260.0230.03720.75
5.6.250.0070.07020.70
5.6.240.0100.06720.70
5.6.230.0100.06020.71
5.6.220.0070.07720.70
5.6.210.0000.04020.61
5.6.200.0070.07720.71
5.6.190.0030.04320.70
5.6.180.0030.04320.61
5.6.170.0000.05320.59
5.6.160.0070.06720.71
5.6.150.0070.04020.61
5.6.140.0070.04320.73
5.6.130.0100.07720.61
5.6.120.0070.07720.90
5.6.110.0100.03720.60
5.6.100.0130.03320.74
5.6.90.0000.04320.73
5.6.80.0070.03720.05
5.6.70.0070.03720.12
5.6.60.0070.03720.07
5.6.50.0100.02719.91
5.6.40.0070.03720.00
5.6.30.0000.04320.12
5.6.20.0070.03719.95
5.6.10.0030.04320.11
5.6.00.0130.03019.99
5.5.380.0030.05317.69
5.5.370.0030.03717.53
5.5.360.0100.07717.55
5.5.350.0000.04317.77
5.5.340.0070.04318.17
5.5.330.0000.04718.28
5.5.320.0100.05318.13
5.5.310.0000.08718.13
5.5.300.0130.06718.22
5.5.290.0030.06718.08
5.5.280.0070.06018.02
5.5.270.0000.04717.96
5.5.260.0000.06017.89
5.5.250.0000.04318.06
5.5.240.0000.04017.48
5.5.230.0030.04317.36
5.5.220.0030.03717.54
5.5.210.0000.04017.55
5.5.200.0100.03717.52
5.5.190.0000.03717.52
5.5.180.0030.04017.35
5.5.160.0000.04017.48
5.5.150.0030.03317.32
5.5.140.0030.03717.54
5.5.130.0070.03317.48
5.5.120.0070.02717.38
5.5.110.0070.03717.63
5.5.100.0030.05317.42
5.5.90.0030.03017.33
5.5.80.0030.03717.45
5.5.70.0030.03317.50
5.5.60.0030.03717.53
5.5.50.0070.03017.52
5.5.40.0030.03017.23
5.5.30.0000.03717.24
5.5.20.0000.03317.52
5.5.10.0030.04717.18
5.5.00.0070.03017.36
5.4.450.0070.04319.36
5.4.440.0100.07319.49
5.4.430.0070.04719.41
5.4.420.0070.04319.50
5.4.410.0000.04719.18
5.4.400.0030.03718.97
5.4.390.0000.04019.18
5.4.380.0030.03719.34
5.4.370.0100.03719.04
5.4.360.0070.02719.02
5.4.350.0130.02319.09
5.4.340.0030.03319.24
5.4.320.0000.04018.95
5.4.310.0070.03319.09
5.4.300.0070.03019.16
5.4.290.0030.03718.99
5.4.280.0130.02719.05
5.4.270.0030.03018.99
5.4.260.0030.03319.16
5.4.250.0000.03319.14
5.4.240.0030.03019.16
5.4.230.0000.04019.23
5.4.220.0030.04018.94
5.4.210.0000.03319.23
5.4.200.0030.03719.16
5.4.190.0070.03019.01
5.4.180.0070.04319.33
5.4.170.0070.03019.33
5.4.160.0030.04319.16
5.4.150.0030.03319.15
5.4.140.0130.05016.54
5.4.130.0030.06016.69
5.4.120.0000.04016.55
5.4.110.0070.02716.55
5.4.100.0070.02716.60
5.4.90.0000.06316.57
5.4.80.0130.05016.46
5.4.70.0030.03316.63
5.4.60.0070.06016.60
5.4.50.0030.03016.60
5.4.40.0070.03716.34
5.4.30.0100.03016.44
5.4.20.0000.07016.60
5.4.10.0030.05016.49
5.4.00.0000.04315.86
5.3.290.0030.03714.88
5.3.280.0030.03014.68
5.3.270.0000.03714.67
5.3.260.0000.04314.70
5.3.250.0100.03314.63
5.3.240.0070.04314.81
5.3.230.0000.03314.80
5.3.220.0000.05014.77
5.3.210.0070.04314.65
5.3.200.0030.03714.64
5.3.190.0030.04714.64
5.3.180.0070.05014.57
5.3.170.0000.05014.62
5.3.160.0000.03714.61
5.3.150.0070.07714.62
5.3.140.0000.07714.48
5.3.130.0070.03714.59
5.3.120.0000.03714.69
5.3.110.0070.07314.63
5.3.100.0000.03314.06
5.3.90.0030.06013.95
5.3.80.0070.06014.06
5.3.70.0070.07313.94
5.3.60.0070.03713.92
5.3.50.0000.03313.99
5.3.40.0030.03714.00
5.3.30.0000.03313.96
5.3.20.0030.03013.76
5.3.10.0000.04013.80
5.3.00.0000.03713.69
5.2.170.0000.03312.07
5.2.160.0070.02312.07
5.2.150.0030.03012.07
5.2.140.0000.04312.07
5.2.130.0000.04012.07
5.2.120.0100.01712.07
5.2.110.0000.03012.07
5.2.100.0000.03012.07
5.2.90.0000.03312.07
5.2.80.0070.03012.07
5.2.70.0070.02312.07
5.2.60.0030.03312.07
5.2.50.0000.03312.07
5.2.40.0030.02712.07
5.2.30.0070.05712.07
5.2.20.0000.02712.07
5.2.10.0000.03012.07
5.2.00.0000.03712.07
5.1.60.0070.02012.07
5.1.50.0070.03712.07
5.1.40.0030.02012.07
5.1.30.0030.05012.07
5.1.20.0100.01712.07
5.1.10.0000.06712.07
5.1.00.0030.05312.07
5.0.50.0070.03712.07
5.0.40.0030.01712.07
5.0.30.0030.03312.07
5.0.20.0030.01712.07
5.0.10.0030.04312.07
5.0.00.0000.05312.07
4.4.90.0000.02712.07
4.4.80.0030.01312.07
4.4.70.0030.01312.07
4.4.60.0070.00712.07
4.4.50.0030.01012.07
4.4.40.0000.05312.07
4.4.30.0070.00712.07
4.4.20.0070.03012.07
4.4.10.0070.03012.07
4.4.00.0000.04012.07
4.3.110.0030.01712.07
4.3.100.0070.01312.07
4.3.90.0000.01712.07
4.3.80.0030.05712.07
4.3.70.0000.02712.07
4.3.60.0000.03712.07
4.3.50.0000.03012.07
4.3.40.0030.04712.07
4.3.30.0000.02012.07
4.3.20.0030.03312.07
4.3.10.0030.03012.07
4.3.00.0000.03312.07

preferences:
47.48 ms | 401 KiB | 5 Q