Bug #78532 [Com]: error control operator not behaving the same as php5
| From: | jcmargentina at gmail dot com | Date: | Fri, 13 Sep 2019 12:37:33 +0000 |
| Subject: | Bug #78532 [Com]: error control operator not behaving the same as php5 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-222732@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=78532&edit=1
ID: 78532
Comment by: jcmargentina at gmail dot com
Reported by: jcmargentina at gmail dot com
Summary: error control operator not behaving the same as php5
Status: Not a bug
Type: Bug
Package: Output Control
PHP Version: 7.1.32
Block user comment: N
Private report: N
New Comment:
Thanks very much for this, I did not find something related to this anywere, now is documented
Previous Comments:
------------------------------------------------------------------------
[2019-09-13 12:25:09] nikic@php.net
This is an intentional change caused by switch from fatal errors to exceptions. Not that in PHP 8, @
will no longer suppress fatal errors either.
------------------------------------------------------------------------
[2019-09-13 12:18:48] bugreports at gmail dot com
a fatal error always halts the script and it won't make sense to supress the error leading to a
white page
------------------------------------------------------------------------
[2019-09-13 12:12:59] jcmargentina at gmail dot com
Description:
------------
I noticed that the Error Control Operator is behaving different in php7 than php5
Test script:
---------------
<?php
function query()
{
$myrs = null;
$tmp = @$myrs->free_result();
return $tmp;
}
var_dump(query());
echo "Another output";
Expected result:
----------------
NOTHING (as of php5)
Actual result:
--------------
Fatal error: Uncaught Error: Call to a member function free_result() on null in [...][...]:6
Stack trace:
#0 [...][...](11): query()
#1 {main}
thrown in [...][...] on line 6
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=78532&edit=1