Sortie du snippet PHP "Récupérer le nom du type d'une variable pour déboguer avec PHP"

Environnement :

  • Strangebuzz Snippet VM : 6.4.2
  • PHP : 8.3

Sortie du code exécuté :

get_debug_type(null) = null
gettype(null) = NULL

get_debug_type(true) = bool
gettype(true) = boolean

get_debug_type(false) = bool
gettype(false) = boolean

get_debug_type(555) = int
gettype(555) = integer

get_debug_type(0.5) = float
gettype(0.5) = double

get_debug_type('foo') = string
gettype('foo') = string

get_debug_type(['foo' => 'bar']) = array
gettype(['foo' => 'bar']) = array

get_debug_type($fp) = resource (stream)
gettype($fp) = resource

get_debug_type($fpClosed) = resource (closed)
gettype($fpClosed) = resource (closed)

get_debug_type($this) = App\Controller\SnippetController
gettype($this) = object

get_debug_type(new class {}) = class@anonymous
gettype(new class {}) = object

get_debug_type(function() {}) = Closure
gettype(function() {}) = object