Private and protected variables : protected « Class « PHP
- PHP
- Class
- protected
Private and protected variables
<?php
class Staff
{
private $name;
private $title;
protected $wage;
protected function clockIn() {
echo "Member $this->name clocked in at ".date("h:i:s");
}
protected function clockOut() {
echo "Member $this->name clocked out at ".date("h:i:s");
}
}
?>
Related examples in the same category