locked class TestClass { public $definedProp;
} $t = new testClass();
$t->definedProp = "OK";
echo $t->definedProp;
unset($t->definedProp); echo $t->nonExistentProp; // Error
$t->nonExistentProp = "Not OK"; // Error
unset($t->definedProp); // Error