- gc_collect_cycles: documentation ( source)
<?php
trait Foo
{
public $hidden;
function __call($name, $arguments)
{
echo 'hello from overload';
}
}
class Bar
{
function hello()
{
echo 'hello from bar';
}
}
class Cheese extends Bar
{
static function deleteMe($obj)
{
unset($obj);
}
}
$foo = new Bar();
Cheese::deleteMe($foo);
gc_collect_cycles();
$foo->hello();