- print_r: documentation ( source)
<?php
class Storage
{
private $things = array();
public function add($item) {
$this->things[] = $item;
}
public function evaluate(Storage $container) {
return $container->things;
}
}
$bucket = new Storage();
$bucket->add("phone");
$bucket->add("biscuits");
$bucket->add("handcream");
$basket = new Storage();
print_r($basket->evaluate($bucket));