Fixed bug #34786 (2 @ results in change to error_reporting() to random value)

This commit is contained in:
Dmitry Stogov 2005-10-10 10:53:52 +00:00
parent b94970a3bd
commit 3019a1c6a3
4 changed files with 28 additions and 4 deletions

2
NEWS
View File

@ -48,6 +48,8 @@ PHP NEWS
- Fixed bug #34788 (SOAP Client not applying correct namespace to generated
values). (Dmitry)
- Fixed bug #34787 (SOAP Client not handling boolean types correctly). (Dmitry)
- Fixed bug #34786 (2 @ results in change to error_reporting() to random value)
(Dmitry, Tony)
- Fixed bug #34785 (subclassing of mysqli_stmt does not work). (Georg)
- Fixed bug #34777 (Crash in dblib when fetching non-existent error info). (Ilia)
- Fixed bug #34771 (strtotime() fails with 1-12am/pm). (Derick)

22
Zend/tests/bug34786.phpt Executable file
View File

@ -0,0 +1,22 @@
--TEST--
Bug #34786 (2 @ results in change to error_reporting() to random value)
--FILE--
<?php
function foo($a,$b,$c) {
echo "foo: ".error_reporting()."\n";
}
function bar() {
echo "bar: ".error_reporting()."\n";
}
error_reporting(1);
echo "before: ".error_reporting()."\n";
@foo(1,@bar(),3);
echo "after: ".error_reporting()."\n";
?>
--EXPECT--
before: 1
bar: 0
foo: 0
after: 1

View File

@ -3447,9 +3447,9 @@ ZEND_VM_HANDLER(57, ZEND_BEGIN_SILENCE, ANY, ANY)
{
zend_op *opline = EX(opline);
EX_T(opline->result.u.var).tmp_var.value.lval = EG(error_reporting);
EX_T(opline->result.u.var).tmp_var.type = IS_LONG; /* shouldn't be necessary */
if (EX(old_error_reporting) == NULL) {
EX_T(opline->result.u.var).tmp_var.value.lval = EG(error_reporting);
EX_T(opline->result.u.var).tmp_var.type = IS_LONG; /* shouldn't be necessary */
EX(old_error_reporting) = &EX_T(opline->result.u.var).tmp_var;
}

View File

@ -429,9 +429,9 @@ static int ZEND_BEGIN_SILENCE_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
EX_T(opline->result.u.var).tmp_var.value.lval = EG(error_reporting);
EX_T(opline->result.u.var).tmp_var.type = IS_LONG; /* shouldn't be necessary */
if (EX(old_error_reporting) == NULL) {
EX_T(opline->result.u.var).tmp_var.value.lval = EG(error_reporting);
EX_T(opline->result.u.var).tmp_var.type = IS_LONG; /* shouldn't be necessary */
EX(old_error_reporting) = &EX_T(opline->result.u.var).tmp_var;
}