You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am sometimes extending the Lua class to provide additional functionality. One problem i have is, that "private" properties of the sub-class are treated like properties of the Lua class which leads to the problem, that the values stored in them get lost. The following code for example prints "NULL":
class a extends Lua {
}
class b extends a {
private $val = 'lua';
public function test() {
var_dump($this->val);
}
}
$b = new b();
$b->test();
I understand, that this happens to "protected" and "public" properties of class b, but shouldn't be the "private" properties treated different?
The text was updated successfully, but these errors were encountered:
Ok ... still think that extending native classes is a valid use case, but yep, i am using a different architecture for this anyway. So ... i am closing.
I am sometimes extending the Lua class to provide additional functionality. One problem i have is, that "private" properties of the sub-class are treated like properties of the Lua class which leads to the problem, that the values stored in them get lost. The following code for example prints "NULL":
I understand, that this happens to "protected" and "public" properties of class b, but shouldn't be the "private" properties treated different?
The text was updated successfully, but these errors were encountered: