diff --git a/reference/var/functions/get-debug-type.xml b/reference/var/functions/get-debug-type.xml new file mode 100644 index 0000000000..2a0d013a60 --- /dev/null +++ b/reference/var/functions/get-debug-type.xml @@ -0,0 +1,211 @@ + + + + + get_debug_type + Gets the type name of a variable in a way that is suitable for debugging + + + + &reftitle.description; + + stringget_debug_type + mixedvalue + + + Returns the resolved name of the PHP variable value. + This function will resolve objects to their class name, resources to their + resource type name, and scalar values to their common name as would be used in type + declarations. + + + This function differs from gettype in that it returns type names + that are more consistent with actual usage, rather than those present for historical reasons. + + + + + &reftitle.parameters; + + + + value + + + The variable being type checked. + + + + + + + + + &reftitle.returnvalues; + + Possible values for the returned string are: + + + + + + Type + State + Return Value + Notes + + + + + null + + "null" + + - + + + Booleans (true or false) + + "bool" + + - + + + Integers + + "int" + + - + + + Floats + + "float" + + - + + + Strings + + "string" + + - + + + Arrays + + "array" + + - + + + Resources + + "resource (resourcename)" + + - + + + Resources (Closed) + + "resource (closed)" + + Example: A file stream after being closed with fclose. + + + Objects from Named Classes + + The full name of the class including its namespace e.g. Foo\Bar + + - + + + Objects from Anonymous Classes + + "class@anonymous" + + + Anonymous classes are those created through the $x = new class { ... } syntax + + + + + + + + + + + &reftitle.examples; + + + <function>gettype</function> example + + +]]> + + &example.outputs.similar; + + + + + + + + + &reftitle.seealso; + + + gettype + get_class + + + + + diff --git a/reference/var/functions/gettype.xml b/reference/var/functions/gettype.xml index 5a67d6cac6..c245732c16 100644 --- a/reference/var/functions/gettype.xml +++ b/reference/var/functions/gettype.xml @@ -90,7 +90,7 @@ 7.2.0 - Closed resources are now reported as 'resource (closed)'. + Closed resources are now reported as 'resource (closed)'. Previously the returned value for closed resources were 'unknown type'. @@ -136,6 +136,7 @@ string &reftitle.seealso; + get_debug_type settype get_class is_array