-
-
Save pssubashps/a48b06b3f421563d2b6b0b0bac78ce80 to your computer and use it in GitHub Desktop.
Access public property
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class MyClass { | |
public $prop; | |
public $variable = "Hello"; | |
function myfunc(){ | |
$this->variable = 'value'; | |
} | |
} | |
$obj = new MyClass; | |
echo $obj->variable; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment