Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:85086 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 6199 invoked from network); 16 Mar 2015 20:06:45 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Mar 2015 20:06:45 -0000 Authentication-Results: pb1.pair.com smtp.mail=davidkmuir@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=davidkmuir@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.52 as permitted sender) X-PHP-List-Original-Sender: davidkmuir@gmail.com X-Host-Fingerprint: 209.85.220.52 mail-pa0-f52.google.com Received: from [209.85.220.52] ([209.85.220.52:34610] helo=mail-pa0-f52.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 19/0B-34940-3D737055 for ; Mon, 16 Mar 2015 15:06:44 -0500 Received: by pacwe9 with SMTP id we9so74302473pac.1 for ; Mon, 16 Mar 2015 13:06:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=references:mime-version:in-reply-to:content-type :content-transfer-encoding:message-id:cc:from:subject:date:to; bh=Rf86S3E4LOaNHtQhjajahThLQVvyTmPo6LlFpEU8IZ8=; b=fo9RwcvmMT9vQDCp6EO9mU7vRQcoQ7QFcNYxRAj4buiIgtfqpQP4+ymmbdbS5/ezTw sevmzT63QiMfh6ouG1GPThzK0enzC4Ssl0xqVyc4Fa10bsKZO7MowHrQ3BgnjTvEoHAR GJUP9gtPP13FXGo7A4xjDGXFyBoGhGO2o05onHA2x/95Lo3G4/vAWsU1FJXQBE/PtoB7 LmmWCuIz0VrN0VJ+j8Gqn2qayWQZHK/f9L6mHgJKg06MyitmXUaxShc/ZXmGKo+Cye8m EBGZyvJQhj9tXwMfXhjbM79DCAKuypGagWkrR8BL0+ONF3s7OVC5rbIonNdQvizy5mXo 1Ffg== X-Received: by 10.66.66.230 with SMTP id i6mr139851005pat.108.1426536400349; Mon, 16 Mar 2015 13:06:40 -0700 (PDT) Received: from [192.168.0.2] (115-64-165-88.static.tpgi.com.au. [115.64.165.88]) by mx.google.com with ESMTPSA id db10sm18653032pdb.86.2015.03.16.13.06.38 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 16 Mar 2015 13:06:39 -0700 (PDT) References: <55033D61.8050405@lsces.co.uk> Mime-Version: 1.0 (1.0) In-Reply-To: Content-Type: multipart/alternative; boundary=Apple-Mail-0151E4EC-5A21-4A1A-A9DB-79997D992EB0 Content-Transfer-Encoding: 7bit Message-ID: Cc: Lester Caine , "internals@lists.php.net" X-Mailer: iPhone Mail (11D257) Date: Tue, 17 Mar 2015 07:06:34 +1100 To: Thomas Punt Subject: Re: [PHP-DEV] STH and the 3 RFCs From: davidkmuir@gmail.com (David Muir) --Apple-Mail-0151E4EC-5A21-4A1A-A9DB-79997D992EB0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable > On 17 Mar 2015, at 1:33 am, Thomas Punt wrote: >=20 > Hey David, >> A library written in weak or strict mode will have no bearing on its publ= ic API. >=20 > Strictly speaking (pun intended), this is not true. A library can easily e= xpose a > facade that enforces a user of that library (who is in weak mode) to have t= o write > in strict mode [1]. Once more, this can be done unintentionally [2] becaus= e of the > caller-deciding semantics. These examples can be further extended into wra= pper > classes, nested library dependencies, etc. >=20 > Sure, you could argue that this could easily be turned off by simply remov= ing the > top declare() statement of that library, but modifying the library in itse= lf introduces > complications - especially when using dependency managers like Composer. >=20 > [1] https://gist.github.com/tpunt/4830d18d47e2df021c2f > [2] https://gist.github.com/tpunt/eecfed2495bdccb73632 >=20 > -Tom =20 No, your example would blow up regardless of the caller being in strict mode= or weak mode. The calls made in the library are strict, and will always fai= l with bad input. All you've shown is that poor code will blow up with poor i= nput validation. If you had: test('1'); It would still error just as before. Cheers, David= --Apple-Mail-0151E4EC-5A21-4A1A-A9DB-79997D992EB0--