| Stanislav Malyshev 2004-07-14, 8:55 am |
| stas Wed Jul 14 05:01:58 2004 EDT
Modified files:
/ZendEngine2 zend_object_handlers.c
Log:
fix #28957
http://cvs.php.net/diff.php/ZendEng...9&r2=1.100&ty=u
Index: ZendEngine2/zend_object_handlers.c
diff -u ZendEngine2/zend_object_handlers.c:1.99 ZendEngine2/zend_object_handlers.c:1.100
--- ZendEngine2/zend_object_handlers.c:1.99 Wed May 26 18:19:44 2004
+++ ZendEngine2/zend_object_handlers.c Wed Jul 14 05:01:58 2004
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_object_handlers.c,v 1.99 2004/05/26 22:19:44 wez Exp $ */
+/* $Id: zend_object_handlers.c,v 1.100 2004/07/14 09:01:58 stas Exp $ */
#include "zend.h"
#include "zend_globals.h"
@@ -381,7 +381,15 @@
zval *retval;
if (instanceof_function_ex(ce, zend_ce_arrayaccess, 1 TSRMLS_CC)) {
+ if(offset == NULL) {
+ /* [] construct */
+ zval offset_null;
+ ZVAL_NULL(&offset_null);
+ zend_call_method_with_1_params(&object, ce, NULL, "offsetget", &retval, &offset_null);
+ zval_dtor(&offset_null); /* just in case */
+ } else {
zend_call_method_with_1_params(&object, ce, NULL, "offsetget", &retval, offset);
+ }
if (!retval) {
if (!EG(exception)) {
zend_error(E_ERROR, "Undefined offset for object of type %s used as array", ce->name);
|