News Feed
Jobs Feed
Sections

Recent Jobs

News Archive
Mike Wallner's Blog:
__get() and array rumors
August 21, 2006 @ 07:49:03

In a brief new post, Mike Wallner talks about some of the discussion surrounding overloaded array properties lately and something he's discovered about it.

As arrays are the only complex types that are passed by value (resources don't really count here) the solution to described problem is simple: use an object; either an instance of stdClass or ArrayObject will do well, depending if you want to use array index notation.

He includes two code examples, one just trying to overload it in a class with __get (yielding an error) and the other using the constructor to pass an ArrayObject out first, allowing for error-free assignment.

0 comments voice your opinion now!
arrayobject overload array properties get construct arrayobject overload array properties get construct



Similar Posts

Derick Rethans' Blog: Overloaded properties (__get)

PHP-Coding-Practices.com: How Table Migrations In CakePHP 1.2 Can Save Your Life

DevShed: Fundamentals of Recursion in PHP (Part 1)

DevShed: Classes as PHP Functions

DevShed: Parsing Web Document Nodes with the Tidy Library in PHP 5


Community Events







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


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

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