summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntony Dovgal <tony2001@php.net>2006-06-01 11:56:23 +0000
committerAntony Dovgal <tony2001@php.net>2006-06-01 11:56:23 +0000
commit57566a78b5512f8debba69db2ed68e4f2fa072aa (patch)
treec56af6c8998543779d6c771c3f2bb7f7115ad4ba
parente24b4215ead2b27ef90ecad024451008a47325e5 (diff)
downloadphp-git-57566a78b5512f8debba69db2ed68e4f2fa072aa.tar.gz
throw a warning when using invalid offset types with strings
-rw-r--r--Zend/zend_execute.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c
index e2bd803857..3f56528a8c 100644
--- a/Zend/zend_execute.c
+++ b/Zend/zend_execute.c
@@ -1112,6 +1112,20 @@ static void zend_fetch_dimension_address(temp_variable *result, zval **container
}
if (Z_TYPE_P(dim) != IS_LONG) {
+ switch(Z_TYPE_P(dim)) {
+ /* case IS_LONG: */
+ case IS_STRING:
+ case IS_UNICODE:
+ case IS_DOUBLE:
+ case IS_NULL:
+ case IS_BOOL:
+ /* do nothing */
+ break;
+ default:
+ zend_error(E_WARNING, "Illegal offset type");
+ break;
+ }
+
tmp = *dim;
zval_copy_ctor(&tmp);
convert_to_long(&tmp);