php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #60362
Patch fix_to_prevent_warning_on_isset_empty_for_55_and_a_half.patch revision 2011-12-21 14:34 UTC by alan_k@php.net
Patch isset_changed_warning_only_on_access.patch revision 2011-12-18 05:08 UTC by alan_k@php.net
Patch string_offset_trigger_notice.patch revision 2011-12-05 05:17 UTC by laruence@php.net
revision 2011-12-04 17:26 UTC by laruence@php.net
Patch fix_disabling_bad_string_offsets revision 2011-12-04 16:43 UTC by laruence@php.net
revision 2011-12-04 12:44 UTC by alan at akbkhome dot com
Patch first_effort_to_fix_this revision 2011-12-03 15:51 UTC by alan at akbkhome dot com
Patch bug60362.sub-sub-keys.phpt revision 2011-11-23 01:40 UTC by danielc at analysisandsolutions dot com

Patch string_offset_trigger_notice.patch for Arrays related Bug #60362

Patch version 2011-12-05 05:17 UTC

Return to Bug #60362 | Download this patch
This patch renders other patches obsolete

Obsolete patches:

Patch Revisions: 2011-12-05 05:17 UTC | 2011-12-04 17:26 UTC

Developer: laruence@php.net

Line 199 (now 199), was 119 lines, now 17 lines

  Index: Zend/tests/indexing_001.phpt
  ===================================================================
  --- Zend/tests/indexing_001.phpt	(revision 320369)
  +++ Zend/tests/indexing_001.phpt	(working copy)
 @@ -48,13 +48,13 @@
 @@ -71,6 +71,8 @@
     }
   }
   
 -Warning: Cannot use a scalar value as an array in %s on line %d
 +Warning: Cannot use a scalar value as an array in %s on line 7
  int(0)
  
 -Warning: Cannot use a scalar value as an array in %s on line %d
 +Warning: Cannot use a scalar value as an array in %s on line 7
  int(1)
  
 -Warning: Cannot use a scalar value as an array in %s on line %d
 +Warning: Cannot use a scalar value as an array in %s on line 7
  bool(true)
  array(1) {
    ["foo"]=>
 @@ -71,10 +71,12 @@
    }
  }
  
 -Notice: Array to string conversion in %s on line %d
 -string(1) "A"
 +Warning: Invalid string offset 'foo' in %s on line 7
  
 -Warning: Cannot use a scalar value as an array in %s on line %d
 +Warning: Illegal string offset:  -1 in %s on line 7
 +string(1) " "
 +Notice: String offset cast occured in %s on line %d
  +
 +Warning: Cannot use a scalar value as an array in %s on line 7
  float(0.1)
  array(1) {
    ["foo"]=>
 @@ -93,13 +95,13 @@
    }
  }
  
 -Warning: Cannot use a scalar value as an array in %s on line %d
 +Warning: Cannot use a scalar value as an array in %s on line 15
  int(0)
  
 -Warning: Cannot use a scalar value as an array in %s on line %d
 +Warning: Cannot use a scalar value as an array in %s on line 15
  int(1)
  
 -Warning: Cannot use a scalar value as an array in %s on line %d
 +Warning: Cannot use a scalar value as an array in %s on line 15
  bool(true)
  array(1) {
    ["foo"]=>
 @@ -116,7 +118,7 @@
    }
  }
  
 -Warning: Cannot use a scalar value as an array in %s on line %d
 +Warning: Cannot use a scalar value as an array in %s on line 15
  float(0.1)
  array(1) {
    ["foo"]=>
 @@ -134,13 +136,13 @@
    }
  }
  
 -Warning: Cannot use a scalar value as an array in %s on line %d
 +Warning: Cannot use a scalar value as an array in %s on line 23
  int(0)
  
 -Warning: Cannot use a scalar value as an array in %s on line %d
 +Warning: Cannot use a scalar value as an array in %s on line 23
  int(1)
  
 -Warning: Cannot use a scalar value as an array in %s on line %d
 +Warning: Cannot use a scalar value as an array in %s on line 23
  bool(true)
  array(1) {
    [0]=>
 @@ -157,7 +159,7 @@
    }
  }
  
 -Warning: Cannot use a scalar value as an array in %s on line %d
 +Warning: Cannot use a scalar value as an array in %s on line 23
  float(0.1)
  array(1) {
    [0]=>
 @@ -176,13 +178,13 @@
    }
  }
  
 -Warning: Cannot use a scalar value as an array in %s on line %d
 +Warning: Cannot use a scalar value as an array in %s on line 31
  int(0)
  
 -Warning: Cannot use a scalar value as an array in %s on line %d
 +Warning: Cannot use a scalar value as an array in %s on line 31
  int(1)
  
 -Warning: Cannot use a scalar value as an array in %s on line %d
 +Warning: Cannot use a scalar value as an array in %s on line 31
  bool(true)
  array(1) {
    [0]=>
 @@ -199,7 +201,7 @@
    }
  }
  Notice: Array to string conversion in %s on line %d
  string(1) "A"
   
 -Warning: Cannot use a scalar value as an array in %s on line %d
 +Warning: Cannot use a scalar value as an array in %s on line 31
  float(0.1)
  array(1) {
    [0]=>
  @@ -209,4 +211,4 @@
     }
   }
   
Line 321 (now 219), was 17 lines, now 16 lines

  Index: Zend/tests/bug54262.phpt
  ===================================================================
  --- Zend/tests/bug54262.phpt	(revision 320369)
  +++ Zend/tests/bug54262.phpt	(working copy)
 @@ -9,7 +9,7 @@
 @@ -9,6 +9,7 @@
   echo "ok\n";
   ?>
   --EXPECTF--
 -bool(true)
 +bool(false)
 +Notice: String offset cast occured in %sbug54262.php on line %d
  bool(true)
   
   Warning: Attempt to modify property of non-object in %sbug54262.php on line 4
  
  Index: Zend/tests/offset_assign.phpt
  ===================================================================
  --- Zend/tests/offset_assign.phpt	(revision 320369)
  +++ Zend/tests/offset_assign.phpt	(working copy)
Line 398 (now 295), was 345 lines, now 185 lines

  Index: Zend/tests/bug31098.phpt
  ===================================================================
  --- Zend/tests/bug31098.phpt	(revision 320369)
  +++ Zend/tests/bug31098.phpt	(working copy)
 @@ -17,7 +17,7 @@
  
  $simpleString = "Bogus String Text";
  echo isset($simpleString->wrong)?"bug\n":"ok\n";
 -echo isset($simpleString["wrong"])?"ok\n":"bug\n";
 +echo isset($simpleString["wrong"])?"bug\n":"ok\n";
  echo isset($simpleString[-1])?"bug\n":"ok\n";
  echo isset($simpleString[0])?"ok\n":"bug\n";
  echo isset($simpleString["0"])?"ok\n":"bug\n";
 @@ -34,8 +34,8 @@
 @@ -33,10 +33,18 @@
   bool(false)
   bool(false)
   bool(false)
 -bool(true)
 -bool(true)
 +bool(false)
 +bool(false)
  ok
 +
 +Notice: String offset cast occured in %sbug31098.php on line %d
  bool(false)
 +
 +Notice: String offset cast occured in %sbug31098.php on line %d
  bool(true)
 +
 +Notice: String offset cast occured in %sbug31098.php on line %d
  bool(true)
   ok
 +
 +Notice: String offset cast occured in %sbug31098.php on line %d
   ok
 @@ -44,8 +44,12 @@
   ok
   ok
 @@ -46,6 +54,10 @@
   
 -Notice: Trying to get property of non-object in %sbug31098.php on line %d
 +Notice: Trying to get property of non-object in %s on line 23
  Notice: Trying to get property of non-object in %sbug31098.php on line %d
   ok
  +
 +Notice: String offset cast occured %s on line 24
 +Notice: String offset cast occured %sbug31098.php on line %d
   ok
   ok
  +
 +Notice: String offset cast occured in %s on line 26
 +Notice: String offset cast occured in %sbug31098.php on line %d
   ok
  Index: Zend/zend_vm_def.h
  ===================================================================
  --- Zend/zend_vm_def.h	(revision 320369)
  +++ Zend/zend_vm_def.h	(working copy)
 @@ -4507,10 +4507,18 @@
 @@ -4507,6 +4507,10 @@
   		zval tmp;
   
   		if (Z_TYPE_P(offset) != IS_LONG) {
 -			ZVAL_COPY_VALUE(&tmp, offset);
 -			zval_copy_ctor(&tmp);
 -			convert_to_long(&tmp);
 -			offset = &tmp;
 +			/** if it's an object/array etc.. */
 +			if (((Z_TYPE_P(offset) != IS_STRING) &&(Z_TYPE_P(offset) != IS_DOUBLE)
 +					   	&& (Z_TYPE_P(offset) != IS_NULL) && (Z_TYPE_P(offset) != IS_BOOL))
 +					|| ((Z_TYPE_P(offset) == IS_STRING) 
 +						&& (IS_LONG != is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, -1)))) {
 +				result = 0;
 +			} else {
 +				ZVAL_COPY_VALUE(&tmp, offset);
 +				zval_copy_ctor(&tmp);
 +				convert_to_long(&tmp);
 +				offset = &tmp;
 +			if ((Z_TYPE_P(offset) == IS_STRING) 
 +					&& (IS_LONG != is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, -1))) {
 +				zend_error(E_NOTICE, "String offset cast occured");
  +			}
  		}
  		if (Z_TYPE_P(offset) == IS_LONG) {
  			if (opline->extended_value & ZEND_ISSET) {
  			ZVAL_COPY_VALUE(&tmp, offset);
  			zval_copy_ctor(&tmp);
  			convert_to_long(&tmp);
  Index: Zend/zend_vm_execute.h
  ===================================================================
  --- Zend/zend_vm_execute.h	(revision 320369)
  +++ Zend/zend_vm_execute.h	(working copy)
 @@ -14035,10 +14035,18 @@
 @@ -14035,6 +14035,10 @@
   		zval tmp;
   
   		if (Z_TYPE_P(offset) != IS_LONG) {
 -			ZVAL_COPY_VALUE(&tmp, offset);
 -			zval_copy_ctor(&tmp);
 -			convert_to_long(&tmp);
 -			offset = &tmp;
 +			/** if it's an object/array etc.. */
 +			if (((Z_TYPE_P(offset) != IS_STRING) &&(Z_TYPE_P(offset) != IS_DOUBLE)
 +					   	&& (Z_TYPE_P(offset) != IS_NULL) && (Z_TYPE_P(offset) != IS_BOOL))
 +					|| ((Z_TYPE_P(offset) == IS_STRING)
 +						&& (IS_LONG != is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, -1)))) {
 +				result = 0;
 +			} else {
 +				ZVAL_COPY_VALUE(&tmp, offset);
 +				zval_copy_ctor(&tmp);
 +				convert_to_long(&tmp);
 +				offset = &tmp;
 +			if ((Z_TYPE_P(offset) == IS_STRING)
 +					&& (IS_LONG != is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, -1))) {
 +				zend_error(E_NOTICE, "String offset cast occured");
  +			}
  		}
  		if (Z_TYPE_P(offset) == IS_LONG) {
  			if (opline->extended_value & ZEND_ISSET) {
 @@ -15941,10 +15949,18 @@
  			ZVAL_COPY_VALUE(&tmp, offset);
  			zval_copy_ctor(&tmp);
  			convert_to_long(&tmp);
 @@ -15941,6 +15945,10 @@
   		zval tmp;
   
   		if (Z_TYPE_P(offset) != IS_LONG) {
 -			ZVAL_COPY_VALUE(&tmp, offset);
 -			zval_copy_ctor(&tmp);
 -			convert_to_long(&tmp);
 -			offset = &tmp;
 +			/** if it's an object/array etc.. */
 +			if (((Z_TYPE_P(offset) != IS_STRING) &&(Z_TYPE_P(offset) != IS_DOUBLE)
 +					   	&& (Z_TYPE_P(offset) != IS_NULL) && (Z_TYPE_P(offset) != IS_BOOL))
 +					|| ((Z_TYPE_P(offset) == IS_STRING)
 +						&& (IS_LONG != is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, -1)))) {
 +				result = 0;
 +			} else {
 +				ZVAL_COPY_VALUE(&tmp, offset);
 +				zval_copy_ctor(&tmp);
 +				convert_to_long(&tmp);
 +				offset = &tmp;
 +			if ((Z_TYPE_P(offset) == IS_STRING)
 +					&& (IS_LONG != is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, -1))) {
 +				zend_error(E_NOTICE, "String offset cast occured");
  +			}
  		}
  		if (Z_TYPE_P(offset) == IS_LONG) {
  			if (opline->extended_value & ZEND_ISSET) {
 @@ -18205,10 +18221,18 @@
  			ZVAL_COPY_VALUE(&tmp, offset);
  			zval_copy_ctor(&tmp);
  			convert_to_long(&tmp);
 @@ -18205,6 +18213,10 @@
   		zval tmp;
   
   		if (Z_TYPE_P(offset) != IS_LONG) {
 -			ZVAL_COPY_VALUE(&tmp, offset);
 -			zval_copy_ctor(&tmp);
 -			convert_to_long(&tmp);
 -			offset = &tmp;
 +			/** if it's an object/array etc.. */
 +			if (((Z_TYPE_P(offset) != IS_STRING) &&(Z_TYPE_P(offset) != IS_DOUBLE)
 +					   	&& (Z_TYPE_P(offset) != IS_NULL) && (Z_TYPE_P(offset) != IS_BOOL))
 +					|| ((Z_TYPE_P(offset) == IS_STRING)
 +						&& (IS_LONG != is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, -1)))) {
 +				result = 0;
 +			} else {
 +				ZVAL_COPY_VALUE(&tmp, offset);
 +				zval_copy_ctor(&tmp);
 +				convert_to_long(&tmp);
 +				offset = &tmp;
 +			if ((Z_TYPE_P(offset) == IS_STRING)
 +					&& (IS_LONG != is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, -1))) {
 +				zend_error(E_NOTICE, "String offset cast occured");
  +			}
  		}
  		if (Z_TYPE_P(offset) == IS_LONG) {
  			if (opline->extended_value & ZEND_ISSET) {
 @@ -21119,10 +21143,18 @@
  			ZVAL_COPY_VALUE(&tmp, offset);
  			zval_copy_ctor(&tmp);
  			convert_to_long(&tmp);
 @@ -21119,6 +21131,10 @@
   		zval tmp;
   
   		if (Z_TYPE_P(offset) != IS_LONG) {
 -			ZVAL_COPY_VALUE(&tmp, offset);
 -			zval_copy_ctor(&tmp);
 -			convert_to_long(&tmp);
 -			offset = &tmp;
 +			/** if it's an object/array etc.. */
 +			if (((Z_TYPE_P(offset) != IS_STRING) &&(Z_TYPE_P(offset) != IS_DOUBLE)
 +					   	&& (Z_TYPE_P(offset) != IS_NULL) && (Z_TYPE_P(offset) != IS_BOOL))
 +					|| ((Z_TYPE_P(offset) == IS_STRING)
 +						&& (IS_LONG != is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, -1)))) {
 +				result = 0;
 +			} else {
 +				ZVAL_COPY_VALUE(&tmp, offset);
 +				zval_copy_ctor(&tmp);
 +				convert_to_long(&tmp);
 +				offset = &tmp;
 +			if ((Z_TYPE_P(offset) == IS_STRING)
 +					&& (IS_LONG != is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, -1))) {
 +				zend_error(E_NOTICE, "String offset cast occured");
  +			}
  		}
  		if (Z_TYPE_P(offset) == IS_LONG) {
  			if (opline->extended_value & ZEND_ISSET) {
 @@ -22446,10 +22478,18 @@
  			ZVAL_COPY_VALUE(&tmp, offset);
  			zval_copy_ctor(&tmp);
  			convert_to_long(&tmp);
 @@ -22446,6 +22462,10 @@
   		zval tmp;
   
   		if (Z_TYPE_P(offset) != IS_LONG) {
 -			ZVAL_COPY_VALUE(&tmp, offset);
 -			zval_copy_ctor(&tmp);
 -			convert_to_long(&tmp);
 -			offset = &tmp;
 +			/** if it's an object/array etc.. */
 +			if (((Z_TYPE_P(offset) != IS_STRING) &&(Z_TYPE_P(offset) != IS_DOUBLE)
 +					   	&& (Z_TYPE_P(offset) != IS_NULL) && (Z_TYPE_P(offset) != IS_BOOL))
 +					|| ((Z_TYPE_P(offset) == IS_STRING)
 +						&& (IS_LONG != is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, -1)))) {
 +				result = 0;
 +			} else {
 +				ZVAL_COPY_VALUE(&tmp, offset);
 +				zval_copy_ctor(&tmp);
 +				convert_to_long(&tmp);
 +				offset = &tmp;
 +			if ((Z_TYPE_P(offset) == IS_STRING)
 +					&& (IS_LONG != is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, -1))) {
 +				zend_error(E_NOTICE, "String offset cast occured");
  +			}
  		}
  		if (Z_TYPE_P(offset) == IS_LONG) {
  			if (opline->extended_value & ZEND_ISSET) {
 @@ -23596,10 +23636,18 @@
  			ZVAL_COPY_VALUE(&tmp, offset);
  			zval_copy_ctor(&tmp);
  			convert_to_long(&tmp);
 @@ -23596,6 +23616,10 @@
   		zval tmp;
   
   		if (Z_TYPE_P(offset) != IS_LONG) {
 -			ZVAL_COPY_VALUE(&tmp, offset);
 -			zval_copy_ctor(&tmp);
 -			convert_to_long(&tmp);
 -			offset = &tmp;
 +			/** if it's an object/array etc.. */
 +			if (((Z_TYPE_P(offset) != IS_STRING) &&(Z_TYPE_P(offset) != IS_DOUBLE)
 +					   	&& (Z_TYPE_P(offset) != IS_NULL) && (Z_TYPE_P(offset) != IS_BOOL))
 +					|| ((Z_TYPE_P(offset) == IS_STRING)
 +						&& (IS_LONG != is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, -1)))) {
 +				result = 0;
 +			} else {
 +				ZVAL_COPY_VALUE(&tmp, offset);
 +				zval_copy_ctor(&tmp);
 +				convert_to_long(&tmp);
 +				offset = &tmp;
 +			if ((Z_TYPE_P(offset) == IS_STRING)
 +					&& (IS_LONG != is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, -1))) {
 +				zend_error(E_NOTICE, "String offset cast occured");
  +			}
  		}
  		if (Z_TYPE_P(offset) == IS_LONG) {
  			if (opline->extended_value & ZEND_ISSET) {
 @@ -24746,10 +24794,18 @@
  			ZVAL_COPY_VALUE(&tmp, offset);
  			zval_copy_ctor(&tmp);
  			convert_to_long(&tmp);
 @@ -24746,6 +24770,10 @@
   		zval tmp;
   
   		if (Z_TYPE_P(offset) != IS_LONG) {
 -			ZVAL_COPY_VALUE(&tmp, offset);
 -			zval_copy_ctor(&tmp);
 -			convert_to_long(&tmp);
 -			offset = &tmp;
 +			/** if it's an object/array etc.. */
 +			if (((Z_TYPE_P(offset) != IS_STRING) &&(Z_TYPE_P(offset) != IS_DOUBLE)
 +					   	&& (Z_TYPE_P(offset) != IS_NULL) && (Z_TYPE_P(offset) != IS_BOOL))
 +					|| ((Z_TYPE_P(offset) == IS_STRING)
 +						&& (IS_LONG != is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, -1)))) {
 +				result = 0;
 +			} else {
 +				ZVAL_COPY_VALUE(&tmp, offset);
 +				zval_copy_ctor(&tmp);
 +				convert_to_long(&tmp);
 +				offset = &tmp;
 +			if ((Z_TYPE_P(offset) == IS_STRING)
 +					&& (IS_LONG != is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, -1))) {
 +				zend_error(E_NOTICE, "String offset cast occured");
  +			}
  		}
  		if (Z_TYPE_P(offset) == IS_LONG) {
  			if (opline->extended_value & ZEND_ISSET) {
 @@ -26162,10 +26218,18 @@
  			ZVAL_COPY_VALUE(&tmp, offset);
  			zval_copy_ctor(&tmp);
  			convert_to_long(&tmp);
 @@ -26162,6 +26190,10 @@
   		zval tmp;
   
   		if (Z_TYPE_P(offset) != IS_LONG) {
 -			ZVAL_COPY_VALUE(&tmp, offset);
 -			zval_copy_ctor(&tmp);
 -			convert_to_long(&tmp);
 -			offset = &tmp;
 +			/** if it's an object/array etc.. */
 +			if (((Z_TYPE_P(offset) != IS_STRING) &&(Z_TYPE_P(offset) != IS_DOUBLE)
 +					   	&& (Z_TYPE_P(offset) != IS_NULL) && (Z_TYPE_P(offset) != IS_BOOL))
 +					|| ((Z_TYPE_P(offset) == IS_STRING)
 +						&& (IS_LONG != is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, -1)))) {
 +				result = 0;
 +			} else {
 +				ZVAL_COPY_VALUE(&tmp, offset);
 +				zval_copy_ctor(&tmp);
 +				convert_to_long(&tmp);
 +				offset = &tmp;
 +			if ((Z_TYPE_P(offset) == IS_STRING)
 +					&& (IS_LONG != is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, -1))) {
 +				zend_error(E_NOTICE, "String offset cast occured");
  +			}
  		}
  		if (Z_TYPE_P(offset) == IS_LONG) {
  			if (opline->extended_value & ZEND_ISSET) {
 @@ -29470,10 +29534,18 @@
  			ZVAL_COPY_VALUE(&tmp, offset);
  			zval_copy_ctor(&tmp);
  			convert_to_long(&tmp);
 @@ -29470,6 +29502,10 @@
   		zval tmp;
   
   		if (Z_TYPE_P(offset) != IS_LONG) {
 -			ZVAL_COPY_VALUE(&tmp, offset);
 -			zval_copy_ctor(&tmp);
 -			convert_to_long(&tmp);
 -			offset = &tmp;
 +			/** if it's an object/array etc.. */
 +			if (((Z_TYPE_P(offset) != IS_STRING) &&(Z_TYPE_P(offset) != IS_DOUBLE)
 +					   	&& (Z_TYPE_P(offset) != IS_NULL) && (Z_TYPE_P(offset) != IS_BOOL))
 +					|| ((Z_TYPE_P(offset) == IS_STRING)
 +						&& (IS_LONG != is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, -1)))) {
 +				result = 0;
 +			} else {
 +				ZVAL_COPY_VALUE(&tmp, offset);
 +				zval_copy_ctor(&tmp);
 +				convert_to_long(&tmp);
 +				offset = &tmp;
 +			if ((Z_TYPE_P(offset) == IS_STRING)
 +					&& (IS_LONG != is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, -1))) {
 +				zend_error(E_NOTICE, "String offset cast occured");
  +			}
  		}
  		if (Z_TYPE_P(offset) == IS_LONG) {
  			if (opline->extended_value & ZEND_ISSET) {
 @@ -31250,10 +31322,18 @@
  			ZVAL_COPY_VALUE(&tmp, offset);
  			zval_copy_ctor(&tmp);
  			convert_to_long(&tmp);
 @@ -31250,6 +31286,10 @@
   		zval tmp;
   
   		if (Z_TYPE_P(offset) != IS_LONG) {
 -			ZVAL_COPY_VALUE(&tmp, offset);
 -			zval_copy_ctor(&tmp);
 -			convert_to_long(&tmp);
 -			offset = &tmp;
 +			/** if it's an object/array etc.. */
 +			if (((Z_TYPE_P(offset) != IS_STRING) &&(Z_TYPE_P(offset) != IS_DOUBLE)
 +					   	&& (Z_TYPE_P(offset) != IS_NULL) && (Z_TYPE_P(offset) != IS_BOOL))
 +					|| ((Z_TYPE_P(offset) == IS_STRING)
 +						&& (IS_LONG != is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, -1)))) {
 +				result = 0;
 +			} else {
 +				ZVAL_COPY_VALUE(&tmp, offset);
 +				zval_copy_ctor(&tmp);
 +				convert_to_long(&tmp);
 +				offset = &tmp;
 +			if ((Z_TYPE_P(offset) == IS_STRING)
 +					&& (IS_LONG != is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, -1))) {
 +				zend_error(E_NOTICE, "String offset cast occured");
  +			}
  		}
  		if (Z_TYPE_P(offset) == IS_LONG) {
  			if (opline->extended_value & ZEND_ISSET) {
 @@ -33387,10 +33467,18 @@
  			ZVAL_COPY_VALUE(&tmp, offset);
  			zval_copy_ctor(&tmp);
  			convert_to_long(&tmp);
 @@ -33387,6 +33427,10 @@
   		zval tmp;
   
   		if (Z_TYPE_P(offset) != IS_LONG) {
 -			ZVAL_COPY_VALUE(&tmp, offset);
 -			zval_copy_ctor(&tmp);
 -			convert_to_long(&tmp);
 -			offset = &tmp;
 +			/** if it's an object/array etc.. */
 +			if (((Z_TYPE_P(offset) != IS_STRING) &&(Z_TYPE_P(offset) != IS_DOUBLE)
 +					   	&& (Z_TYPE_P(offset) != IS_NULL) && (Z_TYPE_P(offset) != IS_BOOL))
 +					|| ((Z_TYPE_P(offset) == IS_STRING)
 +						&& (IS_LONG != is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, -1)))) {
 +				result = 0;
 +			} else {
 +				ZVAL_COPY_VALUE(&tmp, offset);
 +				zval_copy_ctor(&tmp);
 +				convert_to_long(&tmp);
 +				offset = &tmp;
 +			if ((Z_TYPE_P(offset) == IS_STRING)
 +					&& (IS_LONG != is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, -1))) {
 +				zend_error(E_NOTICE, "String offset cast occured");
  +			}
  		}
  		if (Z_TYPE_P(offset) == IS_LONG) {
  			if (opline->extended_value & ZEND_ISSET) {
 @@ -36038,10 +36126,18 @@
  			ZVAL_COPY_VALUE(&tmp, offset);
  			zval_copy_ctor(&tmp);
  			convert_to_long(&tmp);
 @@ -36038,6 +36082,10 @@
   		zval tmp;
   
   		if (Z_TYPE_P(offset) != IS_LONG) {
 -			ZVAL_COPY_VALUE(&tmp, offset);
 -			zval_copy_ctor(&tmp);
 -			convert_to_long(&tmp);
 -			offset = &tmp;
 +			/** if it's an object/array etc.. */
 +			if (((Z_TYPE_P(offset) != IS_STRING) &&(Z_TYPE_P(offset) != IS_DOUBLE)
 +					   	&& (Z_TYPE_P(offset) != IS_NULL) && (Z_TYPE_P(offset) != IS_BOOL))
 +					|| ((Z_TYPE_P(offset) == IS_STRING)
 +						&& (IS_LONG != is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, -1)))) {
 +				result = 0;
 +			} else {
 +				ZVAL_COPY_VALUE(&tmp, offset);
 +				zval_copy_ctor(&tmp);
 +				convert_to_long(&tmp);
 +				offset = &tmp;
 +			if ((Z_TYPE_P(offset) == IS_STRING)
 +					&& (IS_LONG != is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, -1))) {
 +				zend_error(E_NOTICE, "String offset cast occured");
  +			}
  		}
  		if (Z_TYPE_P(offset) == IS_LONG) {
  			if (opline->extended_value & ZEND_ISSET) {
  			ZVAL_COPY_VALUE(&tmp, offset);
  			zval_copy_ctor(&tmp);
  			convert_to_long(&tmp);
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Wed Apr 16 16:02:23 2014 UTC