- var_dump: documentation ( source)
<?php
function creator($var)
{
return new class($var) {
private static $var;
function __construct($var)
{
static::$var = $var;
}
function __debugInfo()
{
return [
"\0*\0var" => static::$var,
];
}
};
}
$a = creator('A');
$b = creator('B');
var_dump($a, $b, $a == $b);