- var_dump: documentation ( source)
<?php
$GLOBALS['bar'] = 5;
function &getSpecialValue() {
return $GLOBALS['bar'];
}
class Foo {
public $value = 3;
function &getValue() {
return $this->value;
}
function test() {
$params = array();
$params[] = &$this->getValue();
$params[] = $this->getValue();
$params[] = &getSpecialValue();
return $params;
}
}
$foo = new Foo();
var_dump($foo->test());