3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php trait Bar { function __destruct() { print_r($this->things); } protected function addThing($n, $v) { $this->things[$n] = $v; } } class Foo { use Bar; public function __construct() { $this->addThing('2', 'two'); } } new Foo();
Output for 7.0.20
Array ( [2] => two )