Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:85163 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 52053 invoked from network); 18 Mar 2015 04:26:24 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Mar 2015 04:26:24 -0000 Authentication-Results: pb1.pair.com smtp.mail=yohgaki@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=yohgaki@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.175 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.214.175 mail-ob0-f175.google.com Received: from [209.85.214.175] ([209.85.214.175:35930] helo=mail-ob0-f175.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 38/15-20523-C6EF8055 for ; Tue, 17 Mar 2015 23:26:21 -0500 Received: by obdfc2 with SMTP id fc2so23604955obd.3 for ; Tue, 17 Mar 2015 21:26:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=KriMNmX0D4DAH7jWMWiuGjKb58DeDHwkVpb9xccXtqM=; b=pr751EjSRrU0aMbuEKhAbeejaD92wr0r5kaXQ4QVlKcS/E2ggfSOUnjShv55yKb0TN vtp/NlzC0R+M5Krk6mkF9mbWaKT4yOi1ZWqKxdrDcDfA0kl1AuSaEQhAS8jBHWsyFqe0 AUWEZZyfvmxo9UdB1LYxZ5nSdk3ARfTeA8IbbOzGyvFs5mi5PcysnhPi+z87/Ev9rbya fQLNehGgWqiC1CuvDgXp6+5qZ5T8N8ztrQKqC5HJ1VDU8veyCJEIi+9TMbhmQiXlJmyh /1nDZ4O/4eUU3HoEZBFoTGbaibvKR4AmRiHOFKLA4L1lexrfLAlu2xDScGFCbsQCwmuw HMyw== X-Received: by 10.202.102.216 with SMTP id m85mr25931217oik.22.1426652778364; Tue, 17 Mar 2015 21:26:18 -0700 (PDT) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.202.58.2 with HTTP; Tue, 17 Mar 2015 21:25:38 -0700 (PDT) In-Reply-To: References: <55079692.6050405@gmail.com> <5507E7DD.3010908@lsces.co.uk> Date: Wed, 18 Mar 2015 13:25:38 +0900 X-Google-Sender-Auth: dEsP1slhSHmjNIkj2qExOdRRAuQ Message-ID: To: =?UTF-8?B?QW5kcsOpIFLDuG1ja2U=?= Cc: Leigh , Lester Caine , PHP Internals List Content-Type: multipart/alternative; boundary=001a1140b2321288280511887cab Subject: Re: [PHP-DEV] [RFC][Accepted] Scalar Type Declarations V0.5 From: yohgaki@ohgaki.net (Yasuo Ohgaki) --001a1140b2321288280511887cab Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Andre, On Wed, Mar 18, 2015 at 8:53 AM, Andr=C3=A9 R=C3=B8mcke wrote: > TL;DR; weak mode is for api consumers, aka normal php users, while stric= t > is > for the actual target users of this features: api (library/framework) > creators. > How could it possible? On Mon, Mar 16, 2015 at 2:49 PM, Dennis Birkholz wrote: > Am 16.03.2015 um 06:28 schrieb Xinchen Hui: > > lib.php > > > declare(strict_types =3D 1); > > function add(int $a, int $b) { > > } > > > > > add($_GET['a'], $_GET['b']); > > > > that means, I need to add a lots of (int) while I try to call a > > function in a library which is not written by myself. > > that is not right and has been discussed a thousand times over. > The declare changes the rules only for function calls in the file it is > declared in. > > so: > lib.php: > declare(strict_types =3D 1); > function foo(int $a) { > // no function call here > } > ?> > The declare here does just nothing. > > require "lib.php"; > foo("123"); // will work > ?> > > declare(strict_types =3D 1); > require "lib.php"; > foo("123"); // will give an error > ?> > > Very easy, explained a thousand times over. Bringing up the same false > arguments up again and again does really not help the discussion. > I didn't have my time to spent for the patch. So I don't verify this by myself, but it seems common sense for this RFC. Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net --001a1140b2321288280511887cab--