1 2 3 4 5 6 7 8 9 10 11 12 13
<?php class xyz { public $abc = ''; function test(){ $this->abc = "world"; } } $a = new xyz(); $a->test(); echo "hello ". $a->abc; ?>
1
hello world