2008/2/19, Cristian Rodriguez <[EMAIL PROTECTED]>:
> 2008/2/19, Felipe Pena <[EMAIL PROTECTED]>:
>
> >
> > Proposed:
> >  - Shows error message (Fatal error, as happens with objects) for
> > integer and float variables.
> >    http://felipe.ath.cx/diff/bug39915.diff
>
> +1 , fatal error for consistency.

you need to handle offset of booleans too..

<?php
$foo = true;

var_dump($foo[1]);
?>

Index: Zend/zend_execute.c
===================================================================
RCS file: /repository/ZendEngine2/zend_execute.c,v
retrieving revision 1.716.2.12.2.24.2.20
diff -u -p -r1.716.2.12.2.24.2.20 zend_execute.c
--- Zend/zend_execute.c 18 Feb 2008 12:11:47 -0000      1.716.2.12.2.24.2.20
+++ Zend/zend_execute.c 19 Feb 2008 04:22:41 -0000
@@ -1229,6 +1229,15 @@ static void zend_fetch_dimension_address
                        }
                        return;
                        break;
+               case IS_LONG:
+                       zend_error_noreturn(E_ERROR, "Cannot use
integer as array");
+                       /* break intentionally missing */
+               case IS_DOUBLE:
+                       zend_error_noreturn(E_ERROR, "Cannot use float
as array");
+                       /* break intentionally missing */
+               case IS_BOOL:
+                       zend_error_noreturn(E_ERROR, "Cannot use
boolean as array");
+                       /* break intentionally missing */

                default:
                        if (result) {






-- 
http://www.cristianrodriguez.net

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to