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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

}<br />

}<br />

// Create a new object<br />

$newobj = new MyOtherClass;<br />

// Attempt to call a protected method<br />

echo $newobj->get<strong>Pro</strong>perty();<br />

?><br />

Upon attempting to run this script, the following error shows up:<br />

The class "MyClass" was initiated!<br />

A new constructor in MyOtherClass.<br />

CHAPTER 3 ■ OBJECT-ORIENTED PROGRAMMING<br />

Fatal error: Call to protected method MyClass::get<strong>Pro</strong>perty() from context '' in <br />

/Applications/XAMPP/xamppfiles/htdocs/testing/test.php on line 55<br />

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

Saved successfully!

Ooh no, something went wrong!