--- /dev/null
+--TEST--
+testing @ and error_reporting - 1
+--FILE--
+<?php
+
+error_reporting(E_ALL);
+
+function foo($arg) {
+}
+
+function bar() {
+ throw new Exception("test");
+}
+
+try {
+ @foo(@bar());
+} catch (Exception $e) {
+}
+
+var_dump(error_reporting());
+
+echo "Done\n";
+?>
+--EXPECT--
+int(2047)
+Done
--- /dev/null
+--TEST--
+testing @ and error_reporting - 2
+--FILE--
+<?php
+
+error_reporting(E_ALL);
+
+function foo($arg) {
+}
+
+function bar() {
+ error_reporting(E_ALL|E_STRICT);
+ throw new Exception("test");
+}
+
+try {
+ @foo(@bar());
+} catch (Exception $e) {
+}
+
+var_dump(error_reporting());
+
+echo "Done\n";
+?>
+--EXPECT--
+int(4095)
+Done
--- /dev/null
+--TEST--
+testing @ and error_reporting - 3
+--FILE--
+<?php
+
+error_reporting(E_ALL);
+
+function foo($arg) {
+ echo @$nonex_foo;
+}
+
+function bar() {
+ echo @$nonex_bar;
+ throw new Exception("test");
+}
+
+function foo1() {
+ echo $undef1;
+ error_reporting(E_ALL|E_STRICT);
+ echo $undef2;
+}
+
+try {
+ @foo(@bar(@foo1()));
+} catch (Exception $e) {
+}
+
+var_dump(error_reporting());
+
+echo "Done\n";
+?>
+--EXPECTF--
+Notice: Undefined variable: undef2 in %s on line %d
+int(4095)
+Done
--- /dev/null
+--TEST--
+testing @ and error_reporting - 4
+--FILE--
+<?php
+
+error_reporting(E_ALL);
+
+function foo() {
+ echo $undef;
+ error_reporting(E_ALL|E_STRICT);
+}
+
+
+foo(@$var);
+
+var_dump(error_reporting());
+
+echo "Done\n";
+?>
+--EXPECTF--
+Notice: Undefined variable: undef in %s on line %d
+int(4095)
+Done
--- /dev/null
+--TEST--
+testing @ and error_reporting - 5
+--FILE--
+<?php
+
+error_reporting(E_ALL);
+
+class test {
+ function __get($name) {
+ return $undef_name;
+ }
+ function __set($name, $value) {
+ return $undef_value;
+ }
+}
+
+$test = new test;
+
+$test->abc = 123;
+echo $test->bcd;
+
+@$test->qwe = 123;
+echo @$test->wer;
+
+var_dump(error_reporting());
+
+echo "Done\n";
+?>
+--EXPECTF--
+Notice: Undefined variable: undef_value in %s on line %d
+
+Notice: Undefined variable: undef_name in %s on line %d
+int(2047)
+Done
--- /dev/null
+--TEST--
+testing @ and error_reporting - 6
+--FILE--
+<?php
+
+error_reporting(E_ALL);
+
+function foo1($arg) {
+}
+
+function foo2($arg) {
+}
+
+function foo3($arg) {
+ echo $undef3;
+ throw new Exception("test");
+}
+
+try {
+ @foo1(@foo2(@foo3()));
+} catch (Exception $e) {
+}
+
+var_dump(error_reporting());
+
+echo "Done\n";
+?>
+--EXPECTF--
+int(2047)
+Done
--- /dev/null
+--TEST--
+testing @ and error_reporting - 7
+--FILE--
+<?php
+
+error_reporting(E_ALL);
+
+function foo1($arg) {
+}
+
+function foo2($arg) {
+}
+
+function foo3($arg) {
+ echo $undef3;
+ throw new Exception("test");
+}
+
+try {
+ @error_reporting(@foo1(@foo2(@foo3())));
+} catch (Exception $e) {
+}
+
+var_dump(error_reporting());
+
+echo "Done\n";
+?>
+--EXPECTF--
+int(2047)
+Done
--- /dev/null
+--TEST--
+testing @ and error_reporting - 8
+--FILE--
+<?php
+
+error_reporting(E_ALL);
+
+function foo1($arg) {
+}
+
+function foo2($arg) {
+}
+
+function foo3($arg) {
+ error_reporting(E_ALL|E_STRICT);
+ echo $undef3;
+ throw new Exception("test");
+}
+
+try {
+ @foo1(@foo2(@foo3()));
+} catch (Exception $e) {
+}
+
+var_dump(error_reporting());
+
+echo "Done\n";
+?>
+--EXPECTF--
+Notice: Undefined variable: undef3 in %s on line %d
+int(4095)
+Done
--- /dev/null
+--TEST--
+testing @ and error_reporting - 9
+--FILE--
+<?php
+
+error_reporting(E_ALL);
+
+function bar() {
+ echo @$blah;
+ echo $undef2;
+}
+
+function foo() {
+ echo @$undef;
+ error_reporting(E_ALL|E_STRICT);
+ echo $blah;
+ return bar();
+}
+
+@foo();
+
+var_dump(error_reporting());
+
+echo "Done\n";
+?>
+--EXPECTF--
+Notice: Undefined variable: blah in %s on line %d
+
+Notice: Undefined variable: undef2 in %s on line %d
+int(4095)
+Done
--- /dev/null
+--TEST--
+testing @ and error_reporting - 10
+--FILE--
+<?php
+
+error_reporting(E_ALL);
+
+function make_exception()
+{
+ @$blah;
+ str_replace();
+ error_reporting(0);
+ throw new Exception();
+}
+
+try {
+ @make_exception();
+} catch (Exception $e) {}
+
+var_dump(error_reporting());
+
+error_reporting(E_ALL&~E_NOTICE);
+
+try {
+ @make_exception();
+} catch (Exception $e) {}
+
+var_dump(error_reporting());
+
+echo "Done\n";
+?>
+--EXPECTF--
+int(0)
+int(0)
+Done