3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Test { public $a = 1; public $b = 2; public $c = 3; } $t1 = new Test(); unset($t1->a); var_dump($t1); $t1->b = (unset) $t1->b; var_dump($t1);
based on A7U1N
Output for 7.2.0
Deprecated: The (unset) cast is deprecated in /in/uX5Sp on line 14 object(Test)#1 (2) { ["b"]=> int(2) ["c"]=> int(3) } object(Test)#1 (2) { ["b"]=> NULL ["c"]=> int(3) }
Output for 5.3.19 - 7.1.10
object(Test)#1 (2) { ["b"]=> int(2) ["c"]=> int(3) } object(Test)#1 (2) { ["b"]=> NULL ["c"]=> int(3) }