Re: Error messages for wrong coding
| From: | Cristian Rodriguez | Date: | Tue, 19 Feb 2008 14:33:02 +0000 |
| Subject: | Re: Error messages for wrong coding | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-35595@lists.php.net to get a copy of this message | ||
2008/2/19, Felipe Pena <felipensp@gmail.com>:
> Em Ter, 2008-02-19 às 01:25 -0300, Cristian Rodriguez escreveu:
> > you need to handle offset of booleans too..
>
> Oops! Thanks.
There is a similar case with unset() an offset of booleans and integers.
<?php
$foo = true:
/* should throw a fatal error, like it does when trying to unset string offsets.
actually $foo remains unchanged after unset() (!!)
unset($foo[0]);
Index: Zend/zend_vm_def.h
===================================================================
RCS file: /repository/ZendEngine2/zend_vm_def.h,v
retrieving revision 1.59.2.29.2.48.2.36
diff -u -p -r1.59.2.29.2.48.2.36 zend_vm_def.h
--- Zend/zend_vm_def.h 11 Feb 2008 15:46:10 -0000 1.59.2.29.2.48.2.36
+++ Zend/zend_vm_def.h 19 Feb 2008 14:32:18 -0000
@@ -3281,6 +3281,7 @@ ZEND_VM_HANDLER(75, ZEND_UNSET_DIM, VAR|
zend_error_noreturn(E_ERROR, "Cannot
unset string offsets");
ZEND_VM_CONTINUE(); /* bailed out before */
default:
+ zend_error_noreturn(E_ERROR, "Cannot
unset %s offsets", zend_get_type_by_const(Z_TYPE_PP(container)));
FREE_OP2();
break;
}
--
http://www.cristianrodriguez.net