<?php
/* @link https://stackoverflow.com/a/79573960/367456 */
$xxx = null;
echo '$xxx: '; var_dump($xxx);
# echoes: $xxx: NULL
echo gettype($xxx), ': ', var_export($xxx, true), "\n";
# echoes: NULL: NULL
echo get_debug_type($xxx), "\n";
# echoes: null
$xxx = false;
echo '$xxx: '; var_dump($xxx);
# echoes: $xxx: bool(false)
echo gettype($xxx), ': ', var_export($xxx, true), "\n";
# echoes: boolean: false
echo get_debug_type($xxx), "\n";
# echoes: bool
$xxx = '';
echo '$xxx: '; var_dump($xxx);
# echoes: $xxx: string(0) ""
echo gettype($xxx), ': ', var_export($xxx, true), "\n";
# echoes: string: ''
echo get_debug_type($xxx), "\n";
# echoes: string
- Output for 8.2.0 - 8.2.29, 8.3.0 - 8.3.25, 8.4.1 - 8.4.12
- $xxx: NULL
NULL: NULL
null
$xxx: bool(false)
boolean: false
bool
$xxx: string(0) ""
string: ''
string
preferences:
53.3 ms | 406 KiB | 5 Q