- var_dump: documentation ( source)
- print_r: documentation ( source)
<?php
class Test
{
static public function getNew()
{
return new static;
}
}
$a = new Test();
$b = new $a();
print_r($b);
print_r($a);
$c = new $a;
var_dump($a !== $b);
var_dump($a !== $c);