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
But the PHP code doesn't work because we cannot set arbitrary variables on object (this is also the case for class instances, let's say you had let a = new MyClass()). Because this is a major difference between the two languages, I doubt it will be easy to fix. I think that the best thing that can be done would be to override __set and __get and keep a private $properties = array() inside each class.
Anyways, I just discovered your project and it looks really interesting, I'll stay updated !
The text was updated successfully, but these errors were encountered:
Given the following JS code:
js2php transpiles it to:
But the PHP code doesn't work because we cannot set arbitrary variables on object (this is also the case for class instances, let's say you had
let a = new MyClass()
). Because this is a major difference between the two languages, I doubt it will be easy to fix. I think that the best thing that can be done would be to override__set
and__get
and keep aprivate $properties = array()
inside each class.Anyways, I just discovered your project and it looks really interesting, I'll stay updated !
The text was updated successfully, but these errors were encountered: