- var_dump: documentation ( source)
<?php
class A {
const HIGH = 0;
public function getStatic()
{
return static::HIGH;
}
public function getSelf()
{
return self::HIGH;
}
}
class B extends A {
const HIGH = 100;
}
$a = new A();
$b = new B();
var_dump([
"a" => [
"self" => $a->getSelf(),
"static" => $a->getStatic()
],
"b" => [
"self" => $b->getSelf(),
"static" => $b->getStatic()
]
]);