News Feed
Jobs Feed
Sections




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

DevShed:
Enforcing Object Types in PHP - Using the PHP5 instanceof Operator
February 23, 2006 @ 07:01:43

DevShed is continuing their "Enforcing Object Types in PHP" series with this new tutorial today. This time, they're focusing mor eon the use of the instanceof operator in PHP5.

This three-part series goes through the basic concepts of object type enforcement in PHP 4/PHP 5. It explores different approaches for checking types of objects to help you avoid possible code contamination when objects of incorrect type are inputted within PHP classes.

The end result of this article hopefully will help you to expand your grounding in how to implement object type enforcement in PHP 5, by developing some illustrative, object-oriented examples.

They start with a look at how not to do the object checking but provide a solution to the situation with the help of the instanceof operator. They explain its usage in the context of the widget class they've created, and show you how it can be integrated easily to simplify object validation.

0 comments voice your opinion now!
enforce object types php5 instanceof validation input enforce object types php5 instanceof validation input


blog comments powered by Disqus

Similar Posts

Developer Tutorials Blog: 5 Ways to be a Better PHP Developer

PHP.net: PHP 4 end of life announcement

Ibuildings Blog: Review: PHP5 CMS Framework Development

Stubbles Blog: Two New PHP6 Wishlist Items

Rob Allen's Blog: A review of "Object-Oriented Programming with PHP5"


Community Events











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


facebook introduction unittest package application component code opinion hhvm language framework hack threedevsandamaybe symfony2 security podcast install release composer overview

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