Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:104232 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 71935 invoked from network); 6 Feb 2019 12:15:01 -0000 Received: from unknown (HELO mail-it1-f180.google.com) (209.85.166.180) by pb1.pair.com with SMTP; 6 Feb 2019 12:15:01 -0000 Received: by mail-it1-f180.google.com with SMTP id b5so4539728iti.2 for ; Wed, 06 Feb 2019 00:56:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=m3WMWiDR2hlRn5ZSoGJ443aM+AZbiG1ms9n+moi7JdI=; b=f28ExJ0ZxBnMnd/ItHym6EPGMKpZhcxrcQLZ9A0HFvZ3l89e9fzplHGFe0eM7lrIcv 6DzzxzoLxnv+88l0Ro0HVMdiQJjxi6Z8lJhSssOMmLOFE5FrdH7uqk8oXu3/cNmhDIJh ZsBOl++BwFxO6fggk1Mor/tBIsAbdx5VvfS8rm8e3pmrO8PC00QFASWglwxtBs8Bw4kx usDq1Dlm81HPuna5bT0IQTM5y934I3ISyefkk6jb6wvXUT0YixgIDoe1xW3MMxUo7ucc hXjRfu+diJsEZ74KcTGeCkXJmIZoj7mZx9Zl0Wu9wOjtQkZBOGkhapnHQh9jg0pl6n7/ Xjpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=m3WMWiDR2hlRn5ZSoGJ443aM+AZbiG1ms9n+moi7JdI=; b=frAkEVOJ8x3Nso+fRXLAOQmaDv5ipU8oEbwYQ4OZpoBKbmr2Sul1SIXsiVqMYKGnwc BJdXNIDwZIFAHboSJAz0lWbiO+jfqI9/0NpnMBiZT0mXjGx9bPBgih4Rxp9JXqrg+m5A 17KlICp6gwBuX/xSj5r1LR8B7SB04vZSMNZOX4W8pwKBnThaveXWRlDaqK5XQxkWNFW8 VdCse1FG22ZNnrhb2fFZnTVP9aIUAhZBQGtUF+/3nnE89mR1QPlrl4OBgEGgP5QdGZxf 1SfocMsTf18kubTZ8SQbHIvrGWhBoDlp5qui6Yduo77s769XMV0AVUlCu3RNmMX/eTVr mH5g== X-Gm-Message-State: AHQUAuYujhjNpNDywdONkDgkFHvVBEHoePH8d27JtZbgzMzIX28L2gYP PEGK/i5OF1XrbMwXzta8rVI8CgPtP11gU6pAPck= X-Google-Smtp-Source: AHgI3IY0kvWOwpjtiNj6OQ0Aw0s6Xvf+RJngY2lHShFEuljEFtI/VYewmcOeB+H5E8UQQWfwm6LXVFdU0VsCziW3g3s= X-Received: by 2002:a05:660c:81a:: with SMTP id j26mr1573032itk.70.1549443381413; Wed, 06 Feb 2019 00:56:21 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Date: Wed, 6 Feb 2019 09:56:02 +0100 Message-ID: To: Nicolas Grekas Cc: PHP Internals List Content-Type: multipart/alternative; boundary="000000000000594de7058135e6d2" Subject: Re: [PHP-DEV] [RFC] Consistent type errors for internal functions From: nikita.ppv@gmail.com (Nikita Popov) --000000000000594de7058135e6d2 Content-Type: text/plain; charset="UTF-8" On Wed, Feb 6, 2019 at 9:43 AM Nicolas Grekas wrote: > > https://wiki.php.net/rfc/consistent_type_errors >>> >>> >>> Would it make sense and be possible to trigger a deprecation notice in >>> PHP 7.4? >>> >>> That might help the ecosystem move forward in a smooth way instead of >>> experimenting the failure when actually moving to 8. >>> >> >> We generally consider a warning a "harder" error than a deprecation >> > > Do all situations that will throw after the RFC trigger a warning right > now? Eg var_dump(substr(null, 1)); doesn't trigger anything but returns > false - does that mean it will not throw a TypeError in your proposal? > That's correct, it will not throw a TypeError. If the call currently succeeds, then it will continue to succeed. substr(null, 1) is considered a perfectly valid substr() call right now. if you are deliberately suppressing warnings, in which case chances are > very good that you are also suppressing deprecations. > > This assumption is wrong in the Symfony ecoystem! > We built the deprecation framework around silenced (and unsilenced) > deprecations, which are all caught and logged. > So it would make a huge difference actually, at least for situations where > no warning is triggered (see substr example above). > Right, but a warning is always triggered here. If there were no warning, then yes, I'd of course agree that this should throw a deprecation first. Nikita --000000000000594de7058135e6d2--