News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

DevShed:
Defining Public and Protected Methods with Member Visibility in PHP 5
June 12, 2008 @ 07:51:13

DevShed continues their series looking at variable scoping in PHP5 classes with this new look at using the public and protected keywords to "restrict member visibility".

Now that you know what will be treated in this fourth chapter of the series, it's time to learn how to declare and implement public and protected methods with PHP 5 classes. Of course, as always I'm going to address this useful topic by using a hands-on approach, which means that there's a bunch of code samples ahead, waiting patiently for you.

They talk about calling methods globally first and then move into the keyword restrictions. They show the difference between a public method/variable and a protected one, including how to get at the protected members from a child class.

0 comments voice your opinion now!
tutorial php5 protected member visibility public child


blog comments powered by Disqus

Similar Posts

PHPMaster.com: Inversion of Control - The Hollywood Principle

Juozas Kaziukenas' Blog: Starting with Zend_Search_Lucene

NETTUTS.com: Build an RSS 2.0 Feed with CodeIgniter

PHP-GTK Community Site: Building a submenu in a GtkMenubar

Robert Ames\' Blog: Upgrading from PHP4 to PHP5


Community Events





Don't see your event here?
Let us know!


language list release experience unittest testing opinion interview framework threedevsandamaybe symfony2 community developer series configure code podcast install laravel introduction

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework