Hello Antony,

Saturday, June 7, 2008, 2:46:54 PM, you wrote:

> tony2001                Sat Jun  7 12:46:54 2008 UTC

>   Modified files:              
>     /php-src/ext/spl    spl_fastarray.c 
>   Log:
>   disallow $a[] = value syntax
>   
>   
> http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_fastarray.c?r1=1.2&r2=1.3&diff_format=u
> Index: php-src/ext/spl/spl_fastarray.c
> diff -u php-src/ext/spl/spl_fastarray.c:1.2 
> php-src/ext/spl/spl_fastarray.c:1.3
> --- php-src/ext/spl/spl_fastarray.c:1.2       Sat Jun  7 01:46:27 2008
> +++ php-src/ext/spl/spl_fastarray.c     Sat Jun  7 12:46:54 2008
> @@ -17,7 +17,7 @@
>    +----------------------------------------------------------------------+
>  */
>  
> -/* $Id: spl_fastarray.c,v 1.2 2008/06/07 01:46:27 colder Exp $ */
> +/* $Id: spl_fastarray.c,v 1.3 2008/06/07 12:46:54 tony2001 Exp $ */
>  
>  #ifdef HAVE_CONFIG_H
>  #include "config.h"
> @@ -321,6 +321,12 @@
>  {
>         long index;
>  
> +       if (!offset) {
> +               /* '$array[] = value' syntax is not supported */
> +               zend_throw_exception(spl_ce_RuntimeException, "Index
> invalid or out of range", 0 TSRMLS_CC);

Why not use OverflowException here?


> +               return;
> +       }
> +
>         index = spl_offset_convert_to_long(offset TSRMLS_CC);
>  
>         if (index < 0 || index >= intern->array->size) {






Best regards,
 Marcus


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to