- var_dump: documentation ( source)
<?php
function foo() {
static $bar;
if ( !$bar ) {
$bar = 123;
}
var_dump($bar);
}
foo();
$refl = new ReflectionFunction( 'foo' );
$statics = $refl->getStaticVariables();
$statics['bar'] = 456;
foo();