Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:98352 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 5252 invoked from network); 25 Feb 2017 19:50:24 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Feb 2017 19:50:24 -0000 Authentication-Results: pb1.pair.com smtp.mail=me@kelunik.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=me@kelunik.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain kelunik.com from 81.169.146.218 cause and error) X-PHP-List-Original-Sender: me@kelunik.com X-Host-Fingerprint: 81.169.146.218 mo4-p00-ob.smtp.rzone.de Received: from [81.169.146.218] ([81.169.146.218:31426] helo=mo4-p00-ob.smtp.rzone.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 1B/3A-11648-EFFD1B85 for ; Sat, 25 Feb 2017 14:50:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1488052219; l=3083; s=domk; d=kelunik.com; h=Content-Type:Cc:To:Subject:Date:From:References:In-Reply-To: MIME-Version; bh=u9FVXAWkxGINdJcSf3+5gaTDr8bv8Bed5c/0mRcB8fE=; b=kfO6UxlP8eL0L9ZSUb0FN3+2aGMEYGrHOdtR9AR1PHZPiZLYFxAl8o8e5eXYEjN3Eu eY/Jij7Z4Ml2YcWT2BUnrLItR+gFq5CjS/fcOsa3CuLqEPDcUlXO/mmf8cPxvDJtaEoB 47RGQkkVbi48viQtqrh4YE7kiDy+E/ZRRSfQ8= X-RZG-AUTH: :IWkkfkWkbvHsXQGmRYmUo9mls2vWuiu+7SLDup6E67mzuoBPBqD/tJ8= X-RZG-CLASS-ID: mo00 Received: from mail-qk0-f174.google.com ([209.85.220.174]) by smtp.strato.de (RZmta 39.13 AUTH) with ESMTPSA id x01699t1PJoJvSX (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (curve secp384r1 with 384 ECDH bits, eq. 7680 bits RSA)) (Client did not present a certificate) for ; Sat, 25 Feb 2017 20:50:19 +0100 (CET) Received: by mail-qk0-f174.google.com with SMTP id n127so49635605qkf.0 for ; Sat, 25 Feb 2017 11:50:19 -0800 (PST) X-Gm-Message-State: AMke39lOZxFXg061q8sZs3xNcWsRsViYbLydgwsJn1JJmPF96R/xzwAe7VFYEHyxBpdJ1Ih4AvXHo7ar+ofGCw== X-Received: by 10.200.42.151 with SMTP id b23mr8537638qta.163.1488052218854; Sat, 25 Feb 2017 11:50:18 -0800 (PST) MIME-Version: 1.0 Received: by 10.12.144.132 with HTTP; Sat, 25 Feb 2017 11:50:18 -0800 (PST) In-Reply-To: <60.D6.11648.6EE91B85@pb1.pair.com> References: <011257B7-C709-4652-909C-5F2B02B0A2E4@gmail.com> <60.D6.11648.6EE91B85@pb1.pair.com> Date: Sat, 25 Feb 2017 20:50:18 +0100 X-Gmail-Original-Message-ID: Message-ID: To: Andrea Faulds Cc: PHP Internals Content-Type: multipart/alternative; boundary=001a1142f5c2e990a00549602731 Subject: Re: [PHP-DEV] Nullable types and strict type-hinting with default null value From: me@kelunik.com (Niklas Keller) --001a1142f5c2e990a00549602731 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 2017-02-25 16:12 GMT+01:00 Andrea Faulds : > Hi, > > Rowan Collins wrote: > >> On 23 February 2017 09:15:27 GMT+00:00, "Micha=C5=82" wr= ote: >> >>> And what about situation when someone is forcing >>> declare(strict_types=3D1)? I think, it's really a good place to force >>> proper types. Including nulls. >>> >> >> strict_types controls the behaviour of *calling* functions, but the chec= k >> here would have to be when *defining* the function: it would give an err= or >> that the function definition is invalid, like if you say function foo(in= t >> $bar=3D'hello') >> >> Unless you had some other behaviour in mind? >> > > In addition to this, if we wanted to prohibit implicit nullability in > parameter definitions, we should have done it when we introduced > declare(strict_types=3D1); in the first place, and that ship has sailed. At that point we didn't even have nullable types, yet. Also, strict_types should do one thing, not all the things related to types= . --001a1142f5c2e990a00549602731--