SHOW:
|
|
- or go back to the newest paste.
| 1 | <?php | |
| 2 | class Car{
| |
| 3 | public $engine; | |
| 4 | } | |
| 5 | class Engine{
| |
| 6 | public $horsepower; | |
| 7 | } | |
| 8 | - | $myCar = new Car(); |
| 8 | + | $myCar = new Car; |
| 9 | $myCar->engine = ???; | |
| 10 | - | $myCar = new Engine(); |
| 10 | + | $myCar2 = new Engine; |
| 11 | - | $mycar->horsepower = 160; |
| 11 | + | $mycar2->horsepower = 160; |
| 12 | ||
| 13 | echo $myCar->engine . "<br>"; | |
| 14 | echo $myCar2->horsepower . "<br>"; | |
| 15 | ?> |