Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:85064 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 46522 invoked from network); 16 Mar 2015 14:52:26 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Mar 2015 14:52:26 -0000 Authentication-Results: pb1.pair.com header.from=j.boggiano@seld.be; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=j.boggiano@seld.be; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain seld.be designates 209.85.212.175 as permitted sender) X-PHP-List-Original-Sender: j.boggiano@seld.be X-Host-Fingerprint: 209.85.212.175 mail-wi0-f175.google.com Received: from [209.85.212.175] ([209.85.212.175:35207] helo=mail-wi0-f175.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 88/22-34940-82EE6055 for ; Mon, 16 Mar 2015 09:52:25 -0500 Received: by wibdy8 with SMTP id dy8so39753803wib.0 for ; Mon, 16 Mar 2015 07:52:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=eVZ2sX86hwvxqJW/NVoMJ5q8ggrdhNANdX9lyySFgZs=; b=fd44HICxElZu6JcWzkD0U4SQEw6y6MrEQAQYcXlSGyLX7t03ZsMZtREpY1g1ffD2xW N8gbT1ZIu6ZRz/FiDnhC4Mp0V9GMK1xKSJL04P8jtwAoz5emvMKRtJh2Qt1fdmqYCWbU zwFJJBZ4/i+hcA1fgyK5fVBMt1BBc0OkvGkYn3PaA30rCmRD8L0YRktORqOug1ZxCAef vjLVudFdEQAhRkDszWKYFayBr9BCwpolIm1HTPdGHzgqA2AcSOKAInKAA3UcggRHMYkF pLLeCEJYoec5xvVUe920x4hvcwLt+OfaWKrQsXaRTbINcn0kvPfa5p1J948ixpP30AX/ H1Lw== X-Gm-Message-State: ALoCoQkHx5WKDxg68KU+I8a/RxBMTS1uNwAg48bsrRQZdnXl8MJdSnn6iupKXJgkrDxPoj+4T+HZ X-Received: by 10.180.19.73 with SMTP id c9mr145213339wie.10.1426517541165; Mon, 16 Mar 2015 07:52:21 -0700 (PDT) Received: from [192.168.1.200] (77-57-47-6.dclient.hispeed.ch. [77.57.47.6]) by mx.google.com with ESMTPSA id ge8sm15734633wjc.32.2015.03.16.07.52.17 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Mar 2015 07:52:20 -0700 (PDT) Message-ID: <5506EE21.9030107@seld.be> Date: Mon, 16 Mar 2015 14:52:17 +0000 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: internals@lists.php.net References: In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] RE: STH and the 3 RFCs From: j.boggiano@seld.be (Jordi Boggiano) On 16/03/2015 14:45, Theodore Brown wrote: > On Monday March 16 at 9:33 am Thomas Punt wrote: > >> Strictly speaking (pun intended), this is not true. A library can easily expose a >> facade that enforces a user of that library (who is in weak mode) to have to write >> in strict mode [1]. Once more, this can be done unintentionally [2] because of the >> caller-deciding semantics. These examples can be further extended into wrapper >> classes, nested library dependencies, etc. >> >> Sure, you could argue that this could easily be turned off by simply removing the >> top declare() statement of that library, but modifying the library in itself introduces >> complications - especially when using dependency managers like Composer. >> >> [1] https://gist.github.com/tpunt/4830d18d47e2df021c2f >> [2] https://gist.github.com/tpunt/eecfed2495bdccb73632 > > This is a bug in the library. It declares strict mode but passes a value it > does not know to be an integer to a method requiring an integer. It can > be fixed by simply adding an int type declaration to the constructor or > test method. Indeed if you enable strict mode you definitely should type-hint all the things *or* validate your inputs. That's a fairly obvious requirement IMO. Cheers