3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $st = new stdClass(); $st->q = new stdClass(); $st->q->k = 1; $st->q->w = 2; $kl = $st; unset($kl->q->k); print_r($st); print_r($kl);
based on sNHQG
Output for 5.0.0 - 7.1.0
stdClass Object ( [q] => stdClass Object ( [w] => 2 ) ) stdClass Object ( [q] => stdClass Object ( [w] => 2 ) )
Output for 4.3.0 - 4.4.9
stdClass Object ( [q] => stdClass Object ( [k] => 1 [w] => 2 ) ) stdClass Object ( [q] => stdClass Object ( [w] => 2 ) )