Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:83102 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 4240 invoked from network); 18 Feb 2015 18:10:51 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Feb 2015 18:10:51 -0000 Authentication-Results: pb1.pair.com header.from=php@golemon.com; sender-id=softfail Authentication-Results: pb1.pair.com smtp.mail=php@golemon.com; spf=softfail; sender-id=softfail Received-SPF: softfail (pb1.pair.com: domain golemon.com does not designate 209.85.215.45 as permitted sender) X-PHP-List-Original-Sender: php@golemon.com X-Host-Fingerprint: 209.85.215.45 mail-la0-f45.google.com Received: from [209.85.215.45] ([209.85.215.45:34704] helo=mail-la0-f45.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D3/A2-25021-AA5D4E45 for ; Wed, 18 Feb 2015 13:10:51 -0500 Received: by labhs14 with SMTP id hs14so2943051lab.1 for ; Wed, 18 Feb 2015 10:10:47 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=tdW3fV6eQc4pr9usTCoHVdlWTjtbYcyGiST7uXcK07k=; b=BpqRPpzl6wrhO1SkQSghIPrq02Kuy8mr3h6Zml//D/Fpyj0+jT3ZvsX39XyC3FqBMT IYlHLq6mRN0Rd0n+0DLk2j4pypAn9tvrU3mf/lX19mFX0Mm9I1yplWfGqyiaRtXtK9/9 54p62JFjz/cs676EmeYb4H4LJWM0HuqPHnRYB8qPWcI5MrDPtDyjY4vyuFtEO8BfSdvA 8dOrUGL+vjB4MghDAgmxhuhANwwLpr/ghGAcqf16tah4SPyTvLgoyZ2dmvi+JKwD6YN/ Fuq7v0ARdr4UzSLdv938N2Zvt23NePS6UYct4mHirQlA8PRny9szrf7yq02mc2d5nyzP w24Q== X-Gm-Message-State: ALoCoQkxGdjSdeZ1fERBiFDnJk0T3ODt3lezKv2uHTBf3A5gHUBozbeZQuJ5v02rJc+rhdTyxL2m MIME-Version: 1.0 X-Received: by 10.152.19.194 with SMTP id h2mr448457lae.77.1424283047740; Wed, 18 Feb 2015 10:10:47 -0800 (PST) Sender: php@golemon.com Received: by 10.112.38.73 with HTTP; Wed, 18 Feb 2015 10:10:47 -0800 (PST) X-Originating-IP: [199.201.64.2] In-Reply-To: References: Date: Wed, 18 Feb 2015 10:10:47 -0800 X-Google-Sender-Auth: 13hHJYcX5iaGJ2nfoPM4aj40fPQ Message-ID: To: Patrick ALLAERT Cc: PHP internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] Scalar Type Hints v0.4 From: pollita@php.net (Sara Golemon) On Wed, Feb 18, 2015 at 7:34 AM, Patrick ALLAERT wrote: > Regarding 2) and 3): > An option might be to implement "weak mode" only and configure the coercion > rules "reporting" in a similar way than with the error_reporting > configuration entry. > > ini_set("coercion_reporting", 0); // current PHP 5.x behaviour > The significant problem with this is that it effects not only the current script, but also all callees (until the next time someone flips the bit). So imagine LibraryA.php was written for PHP5, no scalar type hints, and all that comes with it. Your application turns on COERSION_WARNING and calling LibraryA::doStuff(1,2,3); That call is valid because you're a good programmer who reads the manual and knows how to pass the right args. The author of LibraryA, however, wrote it while drunk at a ruby meetup and is depending on weak conversions all over the place. They even need md5(array()) to output 4410ec34d9e6c1a68100ca0ce033fb17 (yes, I know we don't allow that anymore, enjoy the metaphor) My point is that it potentially imposes new warnings on foreign code. -Sara