Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:100963 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 45802 invoked from network); 27 Oct 2017 11:56:02 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Oct 2017 11:56:02 -0000 Authentication-Results: pb1.pair.com smtp.mail=zoeslam@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=zoeslam@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.128.181 as permitted sender) X-PHP-List-Original-Sender: zoeslam@gmail.com X-Host-Fingerprint: 209.85.128.181 mail-wr0-f181.google.com Received: from [209.85.128.181] ([209.85.128.181:49393] helo=mail-wr0-f181.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 51/3D-28573-0DE13F95 for ; Fri, 27 Oct 2017 07:56:01 -0400 Received: by mail-wr0-f181.google.com with SMTP id g90so5952955wrd.6 for ; Fri, 27 Oct 2017 04:56:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=9QY4Jgcp68EEcl9dae17qAE4pwBpWjfC10BryMj2dGE=; b=Ji2vukyTi1lVCFTvIdHAynIrC9G/MolH/4hflU2/dt7CapcqsQJUj5e5EEJ6Ij97wz /hkReS281xcDnhcSnD3pQVUqkbceKx9NgDkt/+5kZqH7VJuqnIIPTOUuraMTP3/hJcjX EVpL6SzdmDCfAXRa6A9Q4Ym1sBid8e3JAyrXmupWQpEtHvnibhVXGEMPe1ZuGR1uGdqq 0u9Ci8tN6TeFjGAGIs2uhSBKz6iHuqVywMyEOS7DrziV9osJoOFau9KU1AONET/hkJ0d Qd2Qq5fmX7hYRWuHKc3aeXwIsHPugOzZQkmVKtV6XuCAF7LHb1YaiiThwRmhZCzX5B9p BkAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=9QY4Jgcp68EEcl9dae17qAE4pwBpWjfC10BryMj2dGE=; b=Cz+HV1ax9CZCf4N/KWexj4kvP98yykY8S68ECRJ5Bj9C3UV/x0SE/WFV7NtfH15inv N3HSMGpBPDF1+OVc+JNEcLBvaqUuzqI6skHOeOhBuP7c6j7o4fvmr/3oiakHEd6f9mAR ZLBaeZCoTi87EmyJwyxn15MWWz84BJgZdznfApa27DOSpqGv/Wrzv/Wp31gx/H+lMnKj 61fUMOScxsm0mYNkdwKGk8hnJBgsqOtP5abaiJ44GXh1dZWC6/wW1DKOroAiJXzW47vy LKLQEAom5bLpJ2ds7es7iwKewteZX7aV1XJ9OYCbsfbG/m7fPXBlxTxMcL4MpXplVX1h lHYA== X-Gm-Message-State: AMCzsaUH98i6tnmULcA8gz+FY5jr1VH5pBXQCHAvxDUXDqyF4Ou+NRLF Y/gEQAPsUxG/B4MO2Q4w9455elVx X-Google-Smtp-Source: ABhQp+QgZq4SQPtg0CPwmzXsoVBEXO9H+mVZDCrRT8hpuUwBe6tzNs95Y0RYQ/oeGCspQlG1y/KVuQ== X-Received: by 10.223.157.137 with SMTP id p9mr227015wre.98.1509105357436; Fri, 27 Oct 2017 04:55:57 -0700 (PDT) Received: from [192.168.150.163] (93-40-14-184.ip36.fastwebnet.it. [93.40.14.184]) by smtp.gmail.com with ESMTPSA id o11sm7022320wrg.5.2017.10.27.04.55.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Oct 2017 04:55:56 -0700 (PDT) To: "Christoph M. Becker" , internals@lists.php.net References: <7639e065-451b-0f2e-1985-5e3d31ec1b68@gmail.com> <363025d5-bd57-01e6-0fba-0120050cd4dc@gmx.de> Message-ID: Date: Fri, 27 Oct 2017 13:56:00 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <363025d5-bd57-01e6-0fba-0120050cd4dc@gmx.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: Raise E_NOTICE for null castings From: zoeslam@gmail.com (Filippo Tessarotto) I am sorry for partial topic duplication regarding array-access. Still, at least with `declare(strict_types=1);` auto-castings of non-numbers should raise an error: var_dump(false + 2); var_dump(null + 2); Exactly like `"" + 2`. WDYT? Filippo Il 27/10/2017 13:47, Christoph M. Becker ha scritto: > On 27.10.2017 at 11:49, Filippo Tessarotto wrote: > >> 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? > > Note that there is already an accepted RFC regarding rasing E_WARNING > for invalid container read array-access[1]. However, it has not been > implemented yet, due to difficulties, see the discussion on PR #2031[2]. > > [1] > [2] >