Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_builtin_functions.c php-src/tests/lang bug26182.phpt
| From: | Marcus Boerger | Date: | Sat, 29 Nov 2003 14:46:38 +0000 |
| Subject: | Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_builtin_functions.c php-src/tests/lang bug26182.phpt | ||
| References: | 1 2 3 4 | Groups: | php.zend-engine.cvs |
| Request: | Send a blank email to php-zend-engine-cvs+get-2023@lists.php.net to get a copy of this message | ||
Hello Derick,
Friday, November 28, 2003, 10:08:54 AM, you wrote:
> On Thu, 27 Nov 2003, Marcus Boerger wrote:
>> Hello Jani,
>>
>> Thursday, November 27, 2003, 6:09:46 PM, you wrote:
>>
>>
>> > The bug wasn't about this..it was about breaking backwards compatibility
>> > by suddenly creating properties magically..
>>
>> > --Jani
>>
>>
>> And hence it is something to put into BC mode or into E_STRICT. Anyone any
>> opinion on which solution to take? I'd like to do both.
> I would go for E_STRICT only here.
> Derick
Attached is the solution for E_STRICT.
--
Best regards,
Marcus mailto:helly@php.net
? Zend/tests/bug26229.phpt Index: Zend/zend_compile.c =================================================================== RCS file: /repository/ZendEngine2/zend_compile.c,v retrieving revision 1.495 diff -u -p -d -r1.495 zend_compile.c --- Zend/zend_compile.c 24 Nov 2003 18:13:29 -0000 1.495 +++ Zend/zend_compile.c 29 Nov 2003 14:38:56 -0000 @@ -2573,6 +2573,7 @@ void zend_do_declare_implicit_property(T && !zend_hash_exists(&CG(active_class_entry)->properties_info, opline_ptr->op2.u.constant.value.str.val, opline_ptr->op2.u.constant.value.str.len+1)) { znode property; + zend_error(E_STRICT, "Use of undefined property %s->%s", CG(active_class_entry)->name, opline_ptr->op2.u.constant.value.str.val); property = opline_ptr->op2; property.u.constant.value.str.val = estrndup(opline_ptr->op2.u.constant.value.str.val, opline_ptr->op2.u.constant.value.str.len); zend_do_declare_property(&property, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_IMPLICIT_PUBLIC TSRMLS_CC);
? Zend/tests/bug26229.phpt Index: Zend/zend_compile.c =================================================================== RCS file: /repository/ZendEngine2/zend_compile.c,v retrieving revision 1.495 diff -u -p -d -r1.495 zend_compile.c --- Zend/zend_compile.c 24 Nov 2003 18:13:29 -0000 1.495 +++ Zend/zend_compile.c 29 Nov 2003 14:38:56 -0000 @@ -2573,6 +2573,7 @@ void zend_do_declare_implicit_property(T && !zend_hash_exists(&CG(active_class_entry)->properties_info, opline_ptr->op2.u.constant.value.str.val, opline_ptr->op2.u.constant.value.str.len+1)) { znode property; + zend_error(E_STRICT, "Use of undefined property %s->%s", CG(active_class_entry)->name, opline_ptr->op2.u.constant.value.str.val); property = opline_ptr->op2; property.u.constant.value.str.val = estrndup(opline_ptr->op2.u.constant.value.str.val, opline_ptr->op2.u.constant.value.str.len); zend_do_declare_property(&property, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_IMPLICIT_PUBLIC TSRMLS_CC);