rfc:get_debug_type

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
rfc:get_debug_type [2020/02/17 09:45] marandallrfc:get_debug_type [2020/02/17 09:58] – Reformat as table nikic
Line 9: Line 9:
 This RFC proposes to add a new function get_debug_type that will return the given type of a variable. This RFC proposes to add a new function get_debug_type that will return the given type of a variable.
  
-This function would differ from gettype in that it would return native type names, e.g. "int" rather than "integer" and would automatically resolve class names.+This function would differ from gettype in that it would return native type names, e.g. "int" rather than "integer" and would automatically resolve class names. The following table shows what ''get_debug_type()'' returns for different values, and what ''gettype()'' returns for the same value (if it is different):
  
-  * 0 => int  (gettype: integer+^ Value   ^ get_debug_type() ^ gettype(^ 
-  0.1 => float  (gettype: double) +| 0       | int | integer | 
-  true => bool   (gettype: boolean) +0.1     | float double | 
-  false => bool  (gettype: boolean) +true    bool boolean | 
-  "hello" => string   +false   | bool boolean | 
-  [] => array   +"hello" string | | 
-  null => null  (gettype: NULL) +[]      array  | | 
-  A class with name "Foo\Bar" => foo\bar  (previously: object) +null    null NULL | 
-  An anonymous class => class@anonymous  (previously: object) +A class with name "Foo\Bar" | Foo\Bar  object | 
-  A resource => resource (xxx)  (previously: resource) +An anonymous class class@anonymous   | object | 
-  A closed resource => resource (closed)+A resource         | resource (xxx)    resource | 
 +A closed resource  resource (closed) | |
  
 ===== Backward Incompatible Changes ===== ===== Backward Incompatible Changes =====
rfc/get_debug_type.txt · Last modified: 2020/08/01 23:41 by carusogabriel