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