<?php
function f(string $f){}
$f = new ReflectionFunction('f');
$param = $f->getParameters();
var_dump($param[0]);
var_dump(get_class($param[0]));
var_dump(get_class_methods($param[0]));
var_dump($param[0]->getTypeName());
- Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
- object(ReflectionParameter)#2 (1) {
["name"]=>
string(1) "f"
}
string(19) "ReflectionParameter"
array(22) {
[0]=>
string(11) "__construct"
[1]=>
string(10) "__toString"
[2]=>
string(7) "getName"
[3]=>
string(19) "isPassedByReference"
[4]=>
string(18) "canBePassedByValue"
[5]=>
string(20) "getDeclaringFunction"
[6]=>
string(17) "getDeclaringClass"
[7]=>
string(8) "getClass"
[8]=>
string(7) "hasType"
[9]=>
string(7) "getType"
[10]=>
string(7) "isArray"
[11]=>
string(10) "isCallable"
[12]=>
string(10) "allowsNull"
[13]=>
string(11) "getPosition"
[14]=>
string(10) "isOptional"
[15]=>
string(23) "isDefaultValueAvailable"
[16]=>
string(15) "getDefaultValue"
[17]=>
string(22) "isDefaultValueConstant"
[18]=>
string(27) "getDefaultValueConstantName"
[19]=>
string(10) "isVariadic"
[20]=>
string(10) "isPromoted"
[21]=>
string(13) "getAttributes"
}
Fatal error: Uncaught Error: Call to undefined method ReflectionParameter::getTypeName() in /in/7CIMQ:11
Stack trace:
#0 {main}
thrown in /in/7CIMQ on line 11
Process exited with code 255. - Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.6 - 7.2.33, 7.3.16 - 7.3.33, 7.4.0 - 7.4.33
- object(ReflectionParameter)#2 (1) {
["name"]=>
string(1) "f"
}
string(19) "ReflectionParameter"
array(21) {
[0]=>
string(6) "export"
[1]=>
string(11) "__construct"
[2]=>
string(10) "__toString"
[3]=>
string(7) "getName"
[4]=>
string(19) "isPassedByReference"
[5]=>
string(18) "canBePassedByValue"
[6]=>
string(20) "getDeclaringFunction"
[7]=>
string(17) "getDeclaringClass"
[8]=>
string(8) "getClass"
[9]=>
string(7) "hasType"
[10]=>
string(7) "getType"
[11]=>
string(7) "isArray"
[12]=>
string(10) "isCallable"
[13]=>
string(10) "allowsNull"
[14]=>
string(11) "getPosition"
[15]=>
string(10) "isOptional"
[16]=>
string(23) "isDefaultValueAvailable"
[17]=>
string(15) "getDefaultValue"
[18]=>
string(22) "isDefaultValueConstant"
[19]=>
string(27) "getDefaultValueConstantName"
[20]=>
string(10) "isVariadic"
}
Fatal error: Uncaught Error: Call to undefined method ReflectionParameter::getTypeName() in /in/7CIMQ:11
Stack trace:
#0 {main}
thrown in /in/7CIMQ on line 11
Process exited with code 255. - Output for 5.6.7 - 5.6.28
- object(ReflectionParameter)#2 (1) {
["name"]=>
string(1) "f"
}
string(19) "ReflectionParameter"
array(19) {
[0]=>
string(6) "export"
[1]=>
string(11) "__construct"
[2]=>
string(10) "__toString"
[3]=>
string(7) "getName"
[4]=>
string(19) "isPassedByReference"
[5]=>
string(18) "canBePassedByValue"
[6]=>
string(20) "getDeclaringFunction"
[7]=>
string(17) "getDeclaringClass"
[8]=>
string(8) "getClass"
[9]=>
string(7) "isArray"
[10]=>
string(10) "isCallable"
[11]=>
string(10) "allowsNull"
[12]=>
string(11) "getPosition"
[13]=>
string(10) "isOptional"
[14]=>
string(23) "isDefaultValueAvailable"
[15]=>
string(15) "getDefaultValue"
[16]=>
string(22) "isDefaultValueConstant"
[17]=>
string(27) "getDefaultValueConstantName"
[18]=>
string(10) "isVariadic"
}
Fatal error: Call to undefined method ReflectionParameter::getTypeName() in /in/7CIMQ on line 11
Process exited with code 255. - Output for 5.4.6 - 5.4.45, 5.5.24 - 5.5.35
- object(ReflectionParameter)#2 (1) {
["name"]=>
string(1) "f"
}
string(19) "ReflectionParameter"
array(18) {
[0]=>
string(6) "export"
[1]=>
string(11) "__construct"
[2]=>
string(10) "__toString"
[3]=>
string(7) "getName"
[4]=>
string(19) "isPassedByReference"
[5]=>
string(18) "canBePassedByValue"
[6]=>
string(20) "getDeclaringFunction"
[7]=>
string(17) "getDeclaringClass"
[8]=>
string(8) "getClass"
[9]=>
string(7) "isArray"
[10]=>
string(10) "isCallable"
[11]=>
string(10) "allowsNull"
[12]=>
string(11) "getPosition"
[13]=>
string(10) "isOptional"
[14]=>
string(23) "isDefaultValueAvailable"
[15]=>
string(15) "getDefaultValue"
[16]=>
string(22) "isDefaultValueConstant"
[17]=>
string(27) "getDefaultValueConstantName"
}
Fatal error: Call to undefined method ReflectionParameter::getTypeName() in /in/7CIMQ on line 11
Process exited with code 255. - Output for 5.4.0 - 5.4.5
- object(ReflectionParameter)#2 (1) {
["name"]=>
string(1) "f"
}
string(19) "ReflectionParameter"
array(16) {
[0]=>
string(6) "export"
[1]=>
string(11) "__construct"
[2]=>
string(10) "__toString"
[3]=>
string(7) "getName"
[4]=>
string(19) "isPassedByReference"
[5]=>
string(18) "canBePassedByValue"
[6]=>
string(20) "getDeclaringFunction"
[7]=>
string(17) "getDeclaringClass"
[8]=>
string(8) "getClass"
[9]=>
string(7) "isArray"
[10]=>
string(10) "isCallable"
[11]=>
string(10) "allowsNull"
[12]=>
string(11) "getPosition"
[13]=>
string(10) "isOptional"
[14]=>
string(23) "isDefaultValueAvailable"
[15]=>
string(15) "getDefaultValue"
}
Fatal error: Call to undefined method ReflectionParameter::getTypeName() in /in/7CIMQ on line 11
Process exited with code 255. - Output for 5.2.3 - 5.2.17, 5.3.0 - 5.3.29
- object(ReflectionParameter)#2 (1) {
["name"]=>
string(1) "f"
}
string(19) "ReflectionParameter"
array(14) {
[0]=>
string(6) "export"
[1]=>
string(11) "__construct"
[2]=>
string(10) "__toString"
[3]=>
string(7) "getName"
[4]=>
string(19) "isPassedByReference"
[5]=>
string(20) "getDeclaringFunction"
[6]=>
string(17) "getDeclaringClass"
[7]=>
string(8) "getClass"
[8]=>
string(7) "isArray"
[9]=>
string(10) "allowsNull"
[10]=>
string(11) "getPosition"
[11]=>
string(10) "isOptional"
[12]=>
string(23) "isDefaultValueAvailable"
[13]=>
string(15) "getDefaultValue"
}
Fatal error: Call to undefined method ReflectionParameter::getTypeName() in /in/7CIMQ on line 11
Process exited with code 255. - Output for 5.1.3 - 5.1.6, 5.2.0 - 5.2.2
- object(ReflectionParameter)#2 (1) {
["name"]=>
string(1) "f"
}
string(19) "ReflectionParameter"
array(12) {
[0]=>
string(6) "export"
[1]=>
string(11) "__construct"
[2]=>
string(10) "__toString"
[3]=>
string(7) "getName"
[4]=>
string(19) "isPassedByReference"
[5]=>
string(17) "getDeclaringClass"
[6]=>
string(8) "getClass"
[7]=>
string(7) "isArray"
[8]=>
string(10) "allowsNull"
[9]=>
string(10) "isOptional"
[10]=>
string(23) "isDefaultValueAvailable"
[11]=>
string(15) "getDefaultValue"
}
Fatal error: Call to undefined method ReflectionParameter::getTypeName() in /in/7CIMQ on line 11
Process exited with code 255. - Output for 5.1.0 - 5.1.2
- object(ReflectionParameter)#2 (1) {
["name"]=>
string(1) "f"
}
string(19) "ReflectionParameter"
array(11) {
[0]=>
string(6) "export"
[1]=>
string(11) "__construct"
[2]=>
string(10) "__toString"
[3]=>
string(7) "getName"
[4]=>
string(19) "isPassedByReference"
[5]=>
string(8) "getClass"
[6]=>
string(7) "isArray"
[7]=>
string(10) "allowsNull"
[8]=>
string(10) "isOptional"
[9]=>
string(23) "isDefaultValueAvailable"
[10]=>
string(15) "getDefaultValue"
}
Fatal error: Call to undefined method ReflectionParameter::getTypeName() in /in/7CIMQ on line 11
Process exited with code 255. - Output for 5.0.3 - 5.0.5
- object(ReflectionParameter)#2 (1) {
["name"]=>
string(1) "f"
}
string(19) "ReflectionParameter"
array(10) {
[0]=>
string(6) "export"
[1]=>
string(11) "__construct"
[2]=>
string(10) "__toString"
[3]=>
string(7) "getName"
[4]=>
string(19) "isPassedByReference"
[5]=>
string(8) "getClass"
[6]=>
string(10) "allowsNull"
[7]=>
string(10) "isOptional"
[8]=>
string(23) "isDefaultValueAvailable"
[9]=>
string(15) "getDefaultValue"
}
Fatal error: Call to undefined method ReflectionParameter::getTypeName() in /in/7CIMQ on line 11
Process exited with code 255. - Output for 5.0.0 - 5.0.2
- object(ReflectionParameter)#2 (1) {
["name"]=>
string(1) "f"
}
string(19) "ReflectionParameter"
array(8) {
[0]=>
string(7) "__clone"
[1]=>
string(6) "export"
[2]=>
string(11) "__construct"
[3]=>
string(10) "__toString"
[4]=>
string(7) "getName"
[5]=>
string(19) "isPassedByReference"
[6]=>
string(8) "getClass"
[7]=>
string(10) "allowsNull"
}
Fatal error: Call to undefined method ReflectionParameter::getTypeName() in /in/7CIMQ on line 11
Process exited with code 255. - Output for 4.4.2 - 4.4.9
- Parse error: syntax error, unexpected T_STRING, expecting ')' in /in/7CIMQ on line 3
Process exited with code 255. - Output for 4.3.0 - 4.3.1, 4.3.5 - 4.3.11, 4.4.0 - 4.4.1
- Parse error: parse error, unexpected T_STRING, expecting ')' in /in/7CIMQ on line 3
Process exited with code 255. - Output for 4.3.2 - 4.3.4
- Parse error: parse error, expecting `')'' in /in/7CIMQ on line 3
Process exited with code 255.
preferences:
207.81 ms | 401 KiB | 311 Q