Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:100958 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 35439 invoked from network); 27 Oct 2017 10:30:39 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Oct 2017 10:30:39 -0000 Authentication-Results: pb1.pair.com header.from=lists@rhsoft.net; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=lists@rhsoft.net; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain rhsoft.net designates 91.118.73.15 as permitted sender) X-PHP-List-Original-Sender: lists@rhsoft.net X-Host-Fingerprint: 91.118.73.15 mail.thelounge.net Received: from [91.118.73.15] ([91.118.73.15:13845] helo=mail.thelounge.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E3/5B-28573-DCA03F95 for ; Fri, 27 Oct 2017 06:30:38 -0400 Received: from srv-rhsoft.rhsoft.net (Authenticated sender: h.reindl@thelounge.net) by mail.thelounge.net (THELOUNGE MTA) with ESMTPSA id 3yNgBL5DYDzXMj for ; Fri, 27 Oct 2017 12:30:34 +0200 (CEST) To: internals@lists.php.net References: <7639e065-451b-0f2e-1985-5e3d31ec1b68@gmail.com> Message-ID: <45daf06e-e448-f3c9-5cbf-4f947c4db13f@rhsoft.net> Date: Fri, 27 Oct 2017 12:30:34 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <7639e065-451b-0f2e-1985-5e3d31ec1b68@gmail.com> Content-Type: text/plain; charset=iso-8859-15; format=flowed Content-Language: de-CH Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Raise E_NOTICE for null castings From: lists@rhsoft.net ("lists@rhsoft.net") Am 27.10.2017 um 11:49 schrieb Filippo Tessarotto: > Hi, I would like to propose an RFC to raise an E_NOTICE when a variable > "initialized" to null is casted to other types: > > $foo = null; > var_dump($foo['bar']); > var_dump($foo . 'bar'); > var_dump($foo + 2); > var_dump($foo & 2); > // At the time being, this code produces no errors > > The eventual vote may be split one for each case. > > What do you think? pleae don't break code like this which is a useful case for access directly a array field returned from a function and so makes this to a one-liner without check the result public function GetMaxSort(): int { return (int)mysqli_fetch_row($this->cl_api->db->query("select SQL_NO_CACHE max(hsort) from {$this->cl_api->sql_prefix}main", 1))[0]; }