Bug #78532 [Opn->Nab]: error control operator not behaving the same as php5

From: Date: Fri, 13 Sep 2019 12:25:10 +0000
Subject: Bug #78532 [Opn->Nab]: error control operator not behaving the same as php5
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-222731@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 Updated by: nikic@php.net Reported by: jcmargentina at gmail dot com Summary: error control operator not behaving the same as php5 -Status: Open +Status: Not a bug Type: Bug Package: Output Control PHP Version: 7.1.32 Block user comment: N Private report: N New Comment: 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. Previous Comments: ------------------------------------------------------------------------ [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

« previous php.bugs (#222731) next »