« Rasmus's no-framework PHP MVC framework | Main | Zend Framework for PHP5 »

Poka-yoke and PHP

PHP's Marco Tabini has written an interesting article about applying the poka-yoke to PHP code in this months php|architect magazine.

Poka-yoke limits your options to the point where only one choice – the correct one – is possible.

In his example code which is provided, he shows that for example when filtering $_GET and $_POST developers should not be able to just go and set more entries into superglobals like $_GET['foo'] = 'bar'; as well as showing how to only return data via Filter::raw($key) and Filter::html($key) which returns the raw value to the requested key.



TrackBack

TrackBack URL for this entry:
http://www.powertrip.co.za/blog/mt-tb.cgi/506

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)