]> granicus.if.org Git - php/commitdiff
Fixed bug #32428 (The @ warning error supression operator is broken)
authorDmitry Stogov <dmitry@php.net>
Mon, 6 Jun 2005 11:20:46 +0000 (11:20 +0000)
committerDmitry Stogov <dmitry@php.net>
Mon, 6 Jun 2005 11:20:46 +0000 (11:20 +0000)
NEWS
Zend/tests/bug32428.phpt [new file with mode: 0755]
Zend/zend_compile.c

diff --git a/NEWS b/NEWS
index d7e1a520caa114f94b72e54b3a774542188fecc6..cbe6f77cce10496a6732726c5423b2b935c13362 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -129,6 +129,8 @@ PHP                                                                        NEWS
   (Uwe Schindler)
 - Fixed bug #32429 (method_exists() always return TRUE if __call method
   exists). (Dmitry)
+- Fixed bug #32428 (The @ warning error supression operator is broken).
+  (Dmitry)
 - Fixed bug #32427 (Interfaces are not allowed 'static' access modifier).
   (Dmitry)
 - Fixed bug #32109 ($_POST is not populated in multithreaded environment).
diff --git a/Zend/tests/bug32428.phpt b/Zend/tests/bug32428.phpt
new file mode 100755 (executable)
index 0000000..b390c4b
--- /dev/null
@@ -0,0 +1,13 @@
+--TEST--
+Bug #32428 (The @ warning error supression operator is broken)
+--FILE--
+<?php 
+  $data = @$not_exists; 
+  $data = @($not_exists); 
+  $data = @!$not_exists; 
+  $data = !@$not_exists; 
+  $data = @($not_exists+1); 
+  echo "ok\n";
+?>
+--EXPEXT--
+ok
index 31cded48c51c1d94e186eb78c2cc4b2897425509..cdd56f6c0deff858b99ae03d3462d2561b8abe52 100644 (file)
@@ -336,7 +336,9 @@ void fetch_simple_variable_ex(znode *result, znode *varname, int bp, zend_uchar
        if (varname->op_type == IS_CONST && varname->u.constant.type == IS_STRING &&
            !zend_is_auto_global(varname->u.constant.value.str.val, varname->u.constant.value.str.len TSRMLS_CC) &&
            !(varname->u.constant.value.str.len == (sizeof("this")-1) &&
-             !memcmp(varname->u.constant.value.str.val, "this", sizeof("this")))) {
+             !memcmp(varname->u.constant.value.str.val, "this", sizeof("this"))) &&
+           (CG(active_op_array)->last == 0 ||
+            CG(active_op_array)->opcodes[CG(active_op_array)->last-1].opcode != ZEND_BEGIN_SILENCE)) {
                result->op_type = IS_CV;
                result->u.var = lookup_cv(CG(active_op_array), varname->u.constant.value.str.val, varname->u.constant.value.str.len);
                result->u.EA.type = 0;