News Feed
Sections




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

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


blog comments powered by Disqus

Similar Posts

DevShed: Constructing Multi-Line PDF Documents with PHP 5

Antony Dovgal's Blog: 5.3 snapshots are available

Evan Sims' Blog: TwitterBash launches

IBM developerWorks: What's new in PHP V5.2, Part 5: Tracking file upload progress

Eric Ritz: BOTW: PHP Array Filtering (Book Review)


Community Events

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


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

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