- var_dump: documentation ( source)
<?php
class Test {
public function __set($name, $value) {
echo "__set()\n";
$this->$name = $value;
}
}
function foo($bar) {
$bar->{'some_weird_variable'} = 'some value';
$bar->{"\0Test\0another"} = 'one';
}
$obj = new Test();
foo($obj);
var_dump($obj->{'some_weird_variable'});