Public fields
<?php class Staff { public $name; } $employee = new Staff(); $employee->name = "Joe"; $name = $employee->name; echo "www.java2s.com: $name"; ?>