不幸的是,除了修补PHP之外,你无能为力。
但是,如果你想修补PHP,这是一个可能的补丁(针对trunk):
Index: Zend/zend_execute.c
===================================================================
--- Zend/zend_execute.c (revision 316974)
+++ Zend/zend_execute.c (working copy)
@@ -1268,7 +1268,7 @@
case IS_DOUBLE:
case IS_NULL:
case IS_BOOL:
- /* do nothing */
+ zend_error(E_NOTICE, "String offset is not an integer");
break;
default:
zend_error(E_WARNING, "Illegal offset type");然后:
$ ~/php/php-t/bin/php -d error_reporting=-1 -r '$a="foo"; echo $a["bar"];'
Notice: String offset is not an integer in Command line code on line 1
f