News Feed
Jobs Feed
Sections

Recent Jobs

News Archive
Matthew Weir O'Phinney's Blog:
Overloading arrays in PHP 5.2.0
December 29, 2006 @ 07:33:00

Matthew Weir O'Phinney has a new post on his blog today talking about overloading arrays in PHP 5.2.0 using the magic __get and __construct functions.

Several weeks back, a bug was reported against Zend_View that had me initially stumped. [...] Basically, __get() no longer returns a reference and returns values in read mode, which makes modifying arrays using overloading impossible using traditional methods.

He gives a code example of the problem and two ways to get around it - one using a switch statement to get around the problem and the other ("best solution") was Matthew's option to extend the ArrayObject class.

0 comments voice your opinion now!
zend_view overload array php5 switch arrayobject zend_view overload array php5 switch arrayobject



Similar Posts

PHP Security Blog: Month of PHP Bugs and PHP 5.2.1

Secunia.com: Debian Updates for PHP4 and PHP5 Users

Mike Naberezny's Blog: Easier XML-RPC for PHP 5

Lars Strojny's Blog: Antipattern: the verbose constructor

Mike Wallner's Blog: Upgrading to 5.2


Community Events







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


developer cakephp package security application zend code framework database PHP5 example ajax conference releases mysql release zendframework book PEAR job

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