|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-04-23 22:58 UTC] derick@php.net
[2004-04-25 13:17 UTC] helly@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Nov 07 19:00:02 2025 UTC |
Description: ------------ I was developing own array class for php5 and result was not very usable because I can't overload [] -operator.. It's good that iteration is now in php5 but better overloading support is needed. It could work something like this: class xArray { private $data = array(0 => "first", 1 => "second"); function __index($key) { return $this->data[$key] } } $test = new xArray(); print($test[0]); // would print "first"