News 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 - Filtering Input Objects in PHP 4
February 16, 2006 @ 06:56:50

In this latest tutorial on DevShed today, they look at methods to enforce the types of objects in a PHP4 environment.

When you are writing an object-based web application in PHP, you want to prevent your classes from being convoluted with input objects of the incorrect type. These input objects can cause the application to throw a fatal error. In this article, you will learn how to enforce object types in PHP 4.

By the end of this series, hopefully you'll have a clear idea of how to force object types inside of your PHP application, in this way avoiding further problems related to the so-called code contamination.

They start off with the creation of an (X)HTML widgets class to render certain page elements. Then, they show you the creation of a class to render the page and display them in a full document. There are examples of what happens when type checking isn't done and how to enforce the types inside of your class.

0 comments voice your opinion now!
enforcing object types filtering input HTML widgets enforcing object types filtering input HTML widgets


blog comments powered by Disqus

Similar Posts

PHP Security Blog: PHP 5.2.0 and allow_url_include

Kore Nordmann's Blog: Why are you using BBcodes?

WeberDev.com: PHP 101 (part 13): The Trashman Cometh

Paul Jones' Blog: Solar 0.21 and 0.22 released in quick succession

Tony Bibbs' Blog: Geeklog_Generator 1.0.0 Released


Community Events

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


opinion conference example podcast framework language api series part2 community configure introduction interview performance php7 laravel install symfony2 release application

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