Does PHP
have an option to mark a variable as an instance variable or class variable or local variable inside a class?
Ruby
has the following options:
Local variable -> myvar
Instance variable-> @myvar
Class variable -> @@myvar
Is there any such option in PHP other than this lengthy $myvar
, $this->myvar
and self::$myvar
?
I asked like this because I'm from ruby on rails background. There it was so easy to handle variables like as i gave above. In PHP the variable handling style didn't felt so handy. So I referred a docs a lot times. But didn't find any so I asked if I missed any such option in the docs and anyone else may have noticed it.