Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:85044 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 3166 invoked from network); 16 Mar 2015 12:30:25 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Mar 2015 12:30:25 -0000 Authentication-Results: pb1.pair.com header.from=inefedor@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=inefedor@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.217.170 as permitted sender) X-PHP-List-Original-Sender: inefedor@gmail.com X-Host-Fingerprint: 209.85.217.170 mail-lb0-f170.google.com Received: from [209.85.217.170] ([209.85.217.170:34171] helo=mail-lb0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 9D/D6-03331-FDCC6055 for ; Mon, 16 Mar 2015 07:30:24 -0500 Received: by lbbsy1 with SMTP id sy1so29496694lbb.1 for ; Mon, 16 Mar 2015 05:30:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:to:cc:subject:references:date:mime-version :content-transfer-encoding:from:message-id:in-reply-to:user-agent; bh=+3MXxD5URzKdNmx5nGIZFfBmPuZ+MVrPGPlVFr9RdlU=; b=gv01tSjNv1ldiHtQclU4YFKhDn2aDBVnoyu5/XjqfJ1goSMXCn2Y9Z+eKLrFI2M/K1 iJhlodjXo9rxI7JfjZWkVzI7tILP4IR99UIsE2AatfJdytJWUJyuOdEBTbeV5ID0x5Ua Ef/uq26Nt9VTTxlEdFJTCcb//eQonMSPBji8gQsS5g8eIHCY4Ihcw6nh/AQ1foiiwuAU Blkhvcwm2QIbUWZi+uoZGRZrYzDsyt7EGAup6sEqS4DnptaiQjOauJyyflcuBntinbeD T8vuhT+ofgxqIMjkDPgQvKaa0DzbA/L7Suy31FFNsTRPri9cq09Ct3LzCYB+Qj9iSgdJ Y21w== X-Received: by 10.152.6.163 with SMTP id c3mr54383933laa.69.1426509020549; Mon, 16 Mar 2015 05:30:20 -0700 (PDT) Received: from nikita-pc ([89.250.5.98]) by mx.google.com with ESMTPSA id qw1sm2169679lbb.21.2015.03.16.05.30.18 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 16 Mar 2015 05:30:19 -0700 (PDT) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: "Yasuo Ohgaki" Cc: "PHP internals" References: Date: Mon, 16 Mar 2015 15:30:28 +0300 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Message-ID: In-Reply-To: User-Agent: Opera Mail/1.0 (Win32) Subject: Re: [PHP-DEV] About declare(strict_types = 1) From: inefedor@gmail.com ("Nikita Nefedov") On Mon, 16 Mar 2015 14:50:16 +0300, Yasuo Ohgaki wrote: > > I already showed real world example how this could be fail. > > If we need this kind of behavior. I would suggest to have type affinity > like SQLite for > $_GET/$_POST/$_COOKIE. > > https://www.sqlite.org/datatype3.html > > This would work better to work with strict types. I don't see how, given your example, anything would fail. Do you imply that function would get coerced value, but outside of the function you would still have a string and the problem that this string could contain anything? If that's what you were trying to say then I don't consider this as a problem, it's natural flow. If you were to implement type verification in your function on your own you'd get the same results. Perhaps you meant something different?