- debug_zval_dump: documentation ( source)
<?php
class A
{
}
class B
{
}
class Cache
{
protected $store = array();
public function store($object)
{
$this->store[] = $object;
}
public function gc()
{
foreach ($this->store as $object) {
debug_zval_dump($object);
}
}
}
$cache = new Cache();
$cache->store($a = new A);
$cache->store(new B);
$cache->gc();