|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2006-03-01 08:29 UTC] stochnagara at hotmail dot com
Description:
------------
when property and array overloading is used in a combination with a property and array offset taken from variable,
not from constants, PHP fails with 'cannot access empty property message' which is wrong.
Reproduce code:
---------------
<?
class foo_1 implements ArrayAccess {
function offsetGet($q){}
function offsetSet($q,$r){}
function offsetExists($q){}
function offsetUnset ($q) {
echo "unset successful";
}
}
class foo_2 {
function __get($q) {
return new foo_1;
}
}
$f = new foo2;
$m = 'o';
$p = 5;
unset ($f->$m[$p]);
Expected result:
----------------
unset successful
Actual result:
--------------
Cannot access empty property
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Thu May 07 21:00:02 2026 UTC |
Notice the difference between: 1) unset (objectPool()->{$module}[$id]); and 2) unset (objectPool()->{$module[$id]}); No bug here.