- var_dump: documentation ( source)
- define: documentation ( source)
<?php
// define class constant linking to a not defined constant
class Foo {
const FOO = FOO;
}
class Bar {
const BAR = BAR;
}
echo 'Define the linked constant AFTER reading: ' . PHP_EOL;
Foo::FOO;
define('FOO', 'Value of FOO');
var_dump(Foo::FOO);
echo 'Define the linked constant BEFORE reading: ' . PHP_EOL;
define('BAR', 'Value of BAR');
var_dump(Bar::BAR);