- print_r: documentation ( source)
<?php
class foo {
protected static $foo = array
(
1, 5, 9
);
public function printFoo()
{
print_r(self::$foo);
}
public function doThing()
{
$foos = self::$foo;
$foos[] = 12;
return $foos;
}
}
$f = new foo();
$f->printFoo();
print_r($f->doThing());
$f->printFoo();