Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:100719 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 60265 invoked from network); 20 Sep 2017 17:07:21 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Sep 2017 17:07:21 -0000 Authentication-Results: pb1.pair.com header.from=ilija.tovilo@me.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ilija.tovilo@me.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain me.com designates 17.142.194.251 as permitted sender) X-PHP-List-Original-Sender: ilija.tovilo@me.com X-Host-Fingerprint: 17.142.194.251 pv33p00im-asmtp002.me.com Received: from [17.142.194.251] ([17.142.194.251:41766] helo=pv33p00im-asmtp002.me.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8D/98-62331-840A2C95 for ; Wed, 20 Sep 2017 13:07:21 -0400 Received: from process-dkim-sign-daemon.pv33p00im-asmtp002.me.com by pv33p00im-asmtp002.me.com (Oracle Communications Messaging Server 8.0.1.2.20170607 64bit (built Jun 7 2017)) id <0OWL00E0060LPP00@pv33p00im-asmtp002.me.com> for internals@lists.php.net; Wed, 20 Sep 2017 17:07:17 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=04042017; t=1505927237; bh=Ig3NavwZB20A/xt9XPZCSQJZSz3oRjLKo/zUsTAJh/U=; h=Date:From:To:Message-id:Subject:MIME-version:Content-type; b=IJQeBPzOT4PJc/TPi9Y+fu0lEUz8R2hBEaSw/eHyBnM7dBZVGsUPnys0TSGepxk0B FZlLF1Cb1Yjdmtyz8Znwjdn2PJpVvRNEmFeFHXAwFVnxnjfWYb9bajYa0KcQTD2xkr qUs0FZVIokfJLopq3k944oZmcuRUf01wPA0cR2a1RhbNGcXyNDO8O4vHy4kmTwpaf6 hpZR4Xizyh3b99SB4wVBVbxxYg722hF4gcJBFzfYbIzT6IgcLrwbwtefsmPYrHKcCg HDZBXVBmLuneK60DgrOsAY08VZ2leXe9vBWwn0/rp4xP5GiwV85dhoo9OoiJz14zVQ VPIRT7ajrmCJA== Received: from icloud.com ([127.0.0.1]) by pv33p00im-asmtp002.me.com (Oracle Communications Messaging Server 8.0.1.2.20170607 64bit (built Jun 7 2017)) with ESMTPSA id <0OWL00D028VTAC10@pv33p00im-asmtp002.me.com> for internals@lists.php.net; Wed, 20 Sep 2017 17:07:16 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-09-20_04:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1015 suspectscore=30 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1709200232 Date: Wed, 20 Sep 2017 19:06:33 +0200 To: PHP internals Message-ID: <0040eda1-f2d4-408e-a3e1-fe3daf756dfd@Spark> X-Readdle-Message-ID: 0040eda1-f2d4-408e-a3e1-fe3daf756dfd@Spark MIME-version: 1.0 Content-type: multipart/alternative; boundary=59c2a035_6b8b4567_aedc Subject: [RFC] Consistent null behaviour From: ilija.tovilo@me.com --59c2a035_6b8b4567_aedc Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi everybody! To my surprise, I noticed today that an array access on a `null` value returns `null` without any warning whatsoever. Accessing the property of a `null` value gives you a notice, while calling a function on that `null` value gives you a fatal error. https://3v4l.org/ZSZHN This is pretty inconsistent. IMO all of these should be fatal errors, although I realize that might be a bit drastic for PHP 8. We should at least give the user a notice when using array access on a `null` value. Any thoughts? Regards, Ilija --59c2a035_6b8b4567_aedc--