02.06.2013 Views

Pro PHP and jQuery by Jason Lengstorf.pdf - Computer Science ...

Pro PHP and jQuery by Jason Lengstorf.pdf - Computer Science ...

Pro PHP and jQuery by Jason Lengstorf.pdf - Computer Science ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CHAPTER 3 ■ OBJECT-ORIENTED PROGRAMMING<br />

■ Tip In addition to the magic methods discussed in this section, several others are available. For a complete list<br />

of magic methods, see the <strong>PHP</strong> manual page at http://us2.php.net/manual/en/language.oop5.magic.php.<br />

Using Class Inheritance<br />

Classes can inherit the methods <strong>and</strong> properties of another class using the extends keyword. For instance,<br />

to create a second class that extends MyClass <strong>and</strong> adds a method, you would add the following to your<br />

test file:<br />

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!