Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:84985 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 81940 invoked from network); 16 Mar 2015 05:56:18 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Mar 2015 05:56:18 -0000 Authentication-Results: pb1.pair.com header.from=laruence@php.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=xinchen.h@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 209.85.217.179 as permitted sender) X-PHP-List-Original-Sender: xinchen.h@zend.com X-Host-Fingerprint: 209.85.217.179 mail-lb0-f179.google.com Received: from [209.85.217.179] ([209.85.217.179:32889] helo=mail-lb0-f179.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 74/E3-06614-C7076055 for ; Mon, 16 Mar 2015 00:56:13 -0500 Received: by lbbzq9 with SMTP id zq9so24336040lbb.0 for ; Sun, 15 Mar 2015 22:56:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=J77CxoxKNXUdeNRhgeZg3CTGs88DMLxg707s2fH1lSw=; b=HMjetePjbLzRtvMAvG9dx6PQH5XkdKKWe7A47xPnOWdK2Pd3WnmwSd3Md7eXa2ytRf t/ChbrIV/w9743z9bgzLKUELC0G9u1PaR2BwyV9GTmYH5Y7o/lL/u/I6fpXxYZMsr1UE WaRCu2K5dN1t60p23lXj45ZPjREIaYXqQn8fEla/6RH0GosTos2/wDNmmZG9H+YLsWUm 84BNGh+u/ZJpM1ev5IpiMvopMaVKT0VHs/Ygfuiu0EyOLo5Hy56xqzNp8Mm724Vc+UZx q9au4H2aZ4WuWmGrwXarpI64TEhB9PRZ808q/ug28Htpf5I3tyrvhas0XtIJmGuAttvH BAfg== X-Gm-Message-State: ALoCoQnugiwF/aSBOCCuXJM0/1MDGVYf5gOlTqR/CAvOQkJ0IYnkGQfjjnlUzwNARLLlWl8OufjNi4R5sGCfpJ/5bqQYh5VF5TZHPDEYAD2PeZVApPLrwUrhUPKsil7WHsdCUrKwHwT0KVE5d0WHPrAO27t7wQXBDQ== X-Received: by 10.112.56.66 with SMTP id y2mr33649871lbp.22.1426485369485; Sun, 15 Mar 2015 22:56:09 -0700 (PDT) Received: from mail-la0-f44.google.com (mail-la0-f44.google.com. [209.85.215.44]) by mx.google.com with ESMTPSA id q7sm1970964lag.27.2015.03.15.22.56.08 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 15 Mar 2015 22:56:08 -0700 (PDT) Received: by lagg8 with SMTP id g8so30863689lag.1 for ; Sun, 15 Mar 2015 22:56:07 -0700 (PDT) X-Received: by 10.152.37.202 with SMTP id a10mr12714962lak.0.1426485367765; Sun, 15 Mar 2015 22:56:07 -0700 (PDT) MIME-Version: 1.0 Received: by 10.114.82.99 with HTTP; Sun, 15 Mar 2015 22:55:47 -0700 (PDT) In-Reply-To: <55066F07.80308@birkholz.biz> References: <55066F07.80308@birkholz.biz> Date: Mon, 16 Mar 2015 13:55:47 +0800 Message-ID: To: Dennis Birkholz Cc: "internals@lists.php.net >> 'PHP Internals'" Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] About declare(strict_types = 1) From: laruence@php.net (Xinchen Hui) Hey: On Mon, Mar 16, 2015 at 1:49 PM, Dennis Birkholz wrote: > Hello Xinchen, > > Am 16.03.2015 um 06:28 schrieb Xinchen Hui: >> lib.php >> > declare(strict_types = 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 = 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 = 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. That is why I don't see it before (thousand times, too long to read... but not in RFC) anyway, thanks for answering then I have no further questions anymore. thanks > > Greets > Dennis > > > > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php -- Xinchen Hui @Laruence http://www.laruence.com/