ID: 28129
Updated by: [EMAIL PROTECTED]
Reported By: niz at sci dot fi
-Status: Open
+Status: Wont fix
Bug Type: Feature/Change Request
PHP Version: 5.0.0RC1
New Comment:
We're not going to overload any more operators, you can use SPL for
this anyway.
Previous Comments:
------------------------------------------------------------------------
[2004-04-23 19:27:55] niz at sci dot fi
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"
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=28129&edit=1