Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:98356 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 26957 invoked from network); 26 Feb 2017 02:47:14 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Feb 2017 02:47:14 -0000 Authentication-Results: pb1.pair.com header.from=smalyshev@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=smalyshev@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.178 as permitted sender) X-PHP-List-Original-Sender: smalyshev@gmail.com X-Host-Fingerprint: 74.125.82.178 mail-ot0-f178.google.com Received: from [74.125.82.178] ([74.125.82.178:33712] helo=mail-ot0-f178.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 30/6C-11648-1B142B85 for ; Sat, 25 Feb 2017 21:47:13 -0500 Received: by mail-ot0-f178.google.com with SMTP id k4so34848837otc.0 for ; Sat, 25 Feb 2017 18:47:13 -0800 (PST) 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-transfer-encoding; bh=BBMIfUbiQzW4PCfqS1t6CryxvaqJSNVT1uthohdi/KM=; b=idZA1Qmn6CQ0x2ITSc5PlpvNllPLZUwA8vnPfbYqowirn2BZyRXaReJnD30tWZsfrI 8DKkIhCKUG7jgMg31HyaCoGtwK1WS7pAYAS8BBPZ2xUQ6hnzVLjNyD8m5fL/kNG+1qsH VllyW2uiQCyx4bv7/A9V6x8H8ViwtyEojTQK2NCMp3zw5/DPGNjWrgWElXwZklMEHbcP 0V1Oe+CiAyJagAiASIyW+G4fKWiW47zb2t2kkTlnlpgYOzNxt4jPKMU+RR8eMDb4gK04 ZAUiFTf16Rnq9flf/4YqhryvA7e+MH/scJlxd5HX0o9Y84dLSCd4Dg492smBZ/vKA7yY dO/A== 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-transfer-encoding; bh=BBMIfUbiQzW4PCfqS1t6CryxvaqJSNVT1uthohdi/KM=; b=X+FaPZd9cWlsQbhcEiCBJK7DS4jv/HO7edepf+3B+FHbpKot4wkTL1C+FdWOawVcVA d1Au7KMdOWp0wEQtbeQ3zjolAE0CyXUO/voEYMicxMRhfbkiHvjqqdTEJ+yLxLfP9VIv sRBorry+Z9cGPJcFmX611+P00Rw3OJ226hiUGT92rJhTG4dAmhiJl4EKrKSPRABdhu3p Ayf7rbpFiqrdKpgKlDKIqxzYEbunPmXgil8Zf+Wq9RYhZ6fYJIXo9OGnkCHcSEEBb2jV S6EgZWVNInNBKEBsyEE5wtmC4sTcylf+nk13lDPJsK1vct+Bg8n07MloFy1UaBRMcIHm rWWg== X-Gm-Message-State: AMke39luFI3UwqQmnff9tJS14N4e2ACFPqQRriQB518yqBEe9EIAOZq6VUGhbR92IiPQDQ== X-Received: by 10.157.57.136 with SMTP id y8mr5381173otb.145.1488077230711; Sat, 25 Feb 2017 18:47:10 -0800 (PST) Received: from Stas-Air-2731.local (108-233-206-104.lightspeed.sntcca.sbcglobal.net. [108.233.206.104]) by smtp.gmail.com with ESMTPSA id n27sm4738224otd.38.2017.02.25.18.47.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 25 Feb 2017 18:47:09 -0800 (PST) To: =?UTF-8?Q?Micha=c5=82?= , internals@lists.php.net References: Message-ID: Date: Sat, 25 Feb 2017 18:47:07 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Nullable types and strict type-hinting with default null value From: smalyshev@gmail.com (Stanislav Malyshev) Hi! > Scalar types declarations were introduced in PHP 7.0 but it was not > possible to pass null as a default value to function/method. It was > finally done by a small workaround described in documentation as "The > declaration can be made to accept NULL values if the default value of > the parameter is set to NULL". If removing it would make scalar types work differently from non-scalar types, it's not a good idea. Also, I don't see a reason why not have both declarations mean nullable type - the intent is clear in both cases, it's not like it can be confused with something else. -- Stas Malyshev smalyshev@gmail.com