]> granicus.if.org Git - php/commitdiff
Fix warning on non-numeric offsets
authorStanislav Malyshev <stas@php.net>
Thu, 22 Dec 2011 03:22:42 +0000 (03:22 +0000)
committerStanislav Malyshev <stas@php.net>
Thu, 22 Dec 2011 03:22:42 +0000 (03:22 +0000)
Zend/tests/empty_str_offset.phpt
Zend/tests/isset_str_offset.phpt
Zend/zend_vm_def.h
Zend/zend_vm_execute.h

index 09e8d010ffdd0bf4dc76b40a7132d7f4ade2181d..486c052dc4975b0fecf9b100b54c7a15b721d8d2 100644 (file)
@@ -64,9 +64,7 @@ bool(false)
 bool(true)
 bool(true)
 bool(true)
-
-Notice: A non well formed numeric value encountered in %s line %d
-bool(false)
+bool(true)
 - bool ---
 bool(false)
 bool(false)
index 66b025ccec873391fd8bab56aca25fdf4f833bf0..7a9164a381795034dd854719a30e4f0225bd783a 100644 (file)
@@ -64,9 +64,7 @@ bool(true)
 bool(true)
 bool(false)
 bool(false)
-
-Notice: A non well formed numeric value encountered in %s line %d
-bool(true)
+bool(false)
 - bool ---
 bool(true)
 bool(true)
index 2c886bf24b71bfacd8dae64ed75ae674d15772d0..68e49ff6709ff77158d24177e3baa419a5e74dd2 100644 (file)
@@ -4509,7 +4509,7 @@ ZEND_VM_C_LABEL(num_index_prop):
                if (Z_TYPE_P(offset) != IS_LONG) {
                        if (Z_TYPE_P(offset) <= IS_BOOL /* simple scalar types */
                                || (Z_TYPE_P(offset) == IS_STRING /* or numeric string */
-                                               && IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, -1))) {
+                                               && IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, 0))) {
                        ZVAL_COPY_VALUE(&tmp, offset);
                        zval_copy_ctor(&tmp);
                        convert_to_long(&tmp);
index 8a0ef5b04b8eeaed934133c62e837436dcc6b705..2b55a6016ccde14d16425a980ebaf205c1340ef5 100644 (file)
@@ -14037,7 +14037,7 @@ num_index_prop:
                if (Z_TYPE_P(offset) != IS_LONG) {
                        if (Z_TYPE_P(offset) <= IS_BOOL /* simple scalar types */
                                || (Z_TYPE_P(offset) == IS_STRING /* or numeric string */
-                                               && IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, -1))) {
+                                               && IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, 0))) {
                        ZVAL_COPY_VALUE(&tmp, offset);
                        zval_copy_ctor(&tmp);
                        convert_to_long(&tmp);
@@ -15950,7 +15950,7 @@ num_index_prop:
                if (Z_TYPE_P(offset) != IS_LONG) {
                        if (Z_TYPE_P(offset) <= IS_BOOL /* simple scalar types */
                                || (Z_TYPE_P(offset) == IS_STRING /* or numeric string */
-                                               && IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, -1))) {
+                                               && IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, 0))) {
                        ZVAL_COPY_VALUE(&tmp, offset);
                        zval_copy_ctor(&tmp);
                        convert_to_long(&tmp);
@@ -18221,7 +18221,7 @@ num_index_prop:
                if (Z_TYPE_P(offset) != IS_LONG) {
                        if (Z_TYPE_P(offset) <= IS_BOOL /* simple scalar types */
                                || (Z_TYPE_P(offset) == IS_STRING /* or numeric string */
-                                               && IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, -1))) {
+                                               && IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, 0))) {
                        ZVAL_COPY_VALUE(&tmp, offset);
                        zval_copy_ctor(&tmp);
                        convert_to_long(&tmp);
@@ -21142,7 +21142,7 @@ num_index_prop:
                if (Z_TYPE_P(offset) != IS_LONG) {
                        if (Z_TYPE_P(offset) <= IS_BOOL /* simple scalar types */
                                || (Z_TYPE_P(offset) == IS_STRING /* or numeric string */
-                                               && IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, -1))) {
+                                               && IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, 0))) {
                        ZVAL_COPY_VALUE(&tmp, offset);
                        zval_copy_ctor(&tmp);
                        convert_to_long(&tmp);
@@ -22476,7 +22476,7 @@ num_index_prop:
                if (Z_TYPE_P(offset) != IS_LONG) {
                        if (Z_TYPE_P(offset) <= IS_BOOL /* simple scalar types */
                                || (Z_TYPE_P(offset) == IS_STRING /* or numeric string */
-                                               && IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, -1))) {
+                                               && IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, 0))) {
                        ZVAL_COPY_VALUE(&tmp, offset);
                        zval_copy_ctor(&tmp);
                        convert_to_long(&tmp);
@@ -23633,7 +23633,7 @@ num_index_prop:
                if (Z_TYPE_P(offset) != IS_LONG) {
                        if (Z_TYPE_P(offset) <= IS_BOOL /* simple scalar types */
                                || (Z_TYPE_P(offset) == IS_STRING /* or numeric string */
-                                               && IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, -1))) {
+                                               && IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, 0))) {
                        ZVAL_COPY_VALUE(&tmp, offset);
                        zval_copy_ctor(&tmp);
                        convert_to_long(&tmp);
@@ -24790,7 +24790,7 @@ num_index_prop:
                if (Z_TYPE_P(offset) != IS_LONG) {
                        if (Z_TYPE_P(offset) <= IS_BOOL /* simple scalar types */
                                || (Z_TYPE_P(offset) == IS_STRING /* or numeric string */
-                                               && IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, -1))) {
+                                               && IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, 0))) {
                        ZVAL_COPY_VALUE(&tmp, offset);
                        zval_copy_ctor(&tmp);
                        convert_to_long(&tmp);
@@ -26213,7 +26213,7 @@ num_index_prop:
                if (Z_TYPE_P(offset) != IS_LONG) {
                        if (Z_TYPE_P(offset) <= IS_BOOL /* simple scalar types */
                                || (Z_TYPE_P(offset) == IS_STRING /* or numeric string */
-                                               && IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, -1))) {
+                                               && IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, 0))) {
                        ZVAL_COPY_VALUE(&tmp, offset);
                        zval_copy_ctor(&tmp);
                        convert_to_long(&tmp);
@@ -29528,7 +29528,7 @@ num_index_prop:
                if (Z_TYPE_P(offset) != IS_LONG) {
                        if (Z_TYPE_P(offset) <= IS_BOOL /* simple scalar types */
                                || (Z_TYPE_P(offset) == IS_STRING /* or numeric string */
-                                               && IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, -1))) {
+                                               && IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, 0))) {
                        ZVAL_COPY_VALUE(&tmp, offset);
                        zval_copy_ctor(&tmp);
                        convert_to_long(&tmp);
@@ -31315,7 +31315,7 @@ num_index_prop:
                if (Z_TYPE_P(offset) != IS_LONG) {
                        if (Z_TYPE_P(offset) <= IS_BOOL /* simple scalar types */
                                || (Z_TYPE_P(offset) == IS_STRING /* or numeric string */
-                                               && IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, -1))) {
+                                               && IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, 0))) {
                        ZVAL_COPY_VALUE(&tmp, offset);
                        zval_copy_ctor(&tmp);
                        convert_to_long(&tmp);
@@ -33459,7 +33459,7 @@ num_index_prop:
                if (Z_TYPE_P(offset) != IS_LONG) {
                        if (Z_TYPE_P(offset) <= IS_BOOL /* simple scalar types */
                                || (Z_TYPE_P(offset) == IS_STRING /* or numeric string */
-                                               && IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, -1))) {
+                                               && IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, 0))) {
                        ZVAL_COPY_VALUE(&tmp, offset);
                        zval_copy_ctor(&tmp);
                        convert_to_long(&tmp);
@@ -36117,7 +36117,7 @@ num_index_prop:
                if (Z_TYPE_P(offset) != IS_LONG) {
                        if (Z_TYPE_P(offset) <= IS_BOOL /* simple scalar types */
                                || (Z_TYPE_P(offset) == IS_STRING /* or numeric string */
-                                               && IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, -1))) {
+                                               && IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, 0))) {
                        ZVAL_COPY_VALUE(&tmp, offset);
                        zval_copy_ctor(&tmp);
                        convert_to_long(&tmp);