[ create a new paste ] login | about

Link: http://codepad.org/memt6ir8    [ raw code | output | fork ]

upwhere - PHP, pasted on Feb 9:
<?php

class PopStar
{
    public $person;
    public $salary;
    public $album;

    public function setSalary()
    {
        $this->salary = 10000;
    }

    public function getSalary()
    {
        echo $this->salary;
    }
}

$star = new PopStar();
$star->setSalary();
echo "The pop star salary is:";
echo "\n";
$star->getSalary();

?>


Output:
1
2
The pop star salary is:
10000


Create a new paste based on this one


Comments: