summaryrefslogtreecommitdiff
path: root/Zend
diff options
context:
space:
mode:
authorAntony Dovgal <tony2001@php.net>2006-06-01 11:56:44 +0000
committerAntony Dovgal <tony2001@php.net>2006-06-01 11:56:44 +0000
commit29be5946f9b0b10f85ca28aa69c64a7bd275bed3 (patch)
treea5db78af8e6a926198b1aaeaaccbb8ae39dbcb19 /Zend
parent378d5d4e349dff90107211f508360890b9508e17 (diff)
downloadphp-git-29be5946f9b0b10f85ca28aa69c64a7bd275bed3.tar.gz
MFH: throw a warning when using invalid offset types with strings
Diffstat (limited to 'Zend')
-rw-r--r--Zend/zend_execute.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c
index 2c4a457a70..f7a19a5845 100644
--- a/Zend/zend_execute.c
+++ b/Zend/zend_execute.c
@@ -1016,6 +1016,19 @@ 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_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);