Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:85009 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 31112 invoked from network); 16 Mar 2015 09:05:55 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Mar 2015 09:05:55 -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.171 as permitted sender) X-PHP-List-Original-Sender: xinchen.h@zend.com X-Host-Fingerprint: 209.85.217.171 mail-lb0-f171.google.com Received: from [209.85.217.171] ([209.85.217.171:35251] helo=mail-lb0-f171.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 90/55-00492-BEC96055 for ; Mon, 16 Mar 2015 04:05:49 -0500 Received: by lbcgn8 with SMTP id gn8so15941723lbc.2 for ; Mon, 16 Mar 2015 02:05:44 -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=Aj6E8wLw+9uS+SDOxvI2/UVqK8qSGs7to3PVmPkYCps=; b=Czdh0hzHPdovGJ1NWcz8qfZI96vY8j+cvwX+kTZo/quvfEUvNTjAJt7H+xCIVfwP3f 7S7tA6VR1kNoo6yJqeyAxKMesuHK4krlkPe2bADZUdSyHhA9EKnd5X1WHEaZtePNHvgS W6clAFmfMNcz0quSK6d55ILYrCDw01iXicabuQn7svQ1ykjdbFD3gZEcr0dm64jeflM2 CGAFzhXXLbsDymTJ9ro7uiaLm1rTmU/3+soqgo3Q1g7hHWjIyfaDKXamQciX4Ye8GA8V Am7y3e8USlo8FypAvlmWDVavgnwGOTto5Rj02zQ1CN5+bUODuqEwuxu3o1qgS8faBL+j o40Q== X-Gm-Message-State: ALoCoQluMxG1H6h1KnNcnmROmXWD2QrFhdJHs6B6mLxWNAcu7oLK9nDldii73bkhzKw2pdRb6RaN4EslaXN8JhEmTrFGHD4PXSNKwU7+wIijCTafp6/g4dutZ9jUnTPHLlbacp58BBJCWKSQbXkktHaHdn8jtNz3Wg== X-Received: by 10.112.137.164 with SMTP id qj4mr42277760lbb.17.1426496744402; Mon, 16 Mar 2015 02:05:44 -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 mm7sm2067925lbb.30.2015.03.16.02.05.43 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Mar 2015 02:05:43 -0700 (PDT) Received: by lagg8 with SMTP id g8so33991453lag.1 for ; Mon, 16 Mar 2015 02:05:42 -0700 (PDT) X-Received: by 10.112.188.227 with SMTP id gd3mr35048639lbc.0.1426496742471; Mon, 16 Mar 2015 02:05:42 -0700 (PDT) MIME-Version: 1.0 Received: by 10.114.82.99 with HTTP; Mon, 16 Mar 2015 02:05:21 -0700 (PDT) In-Reply-To: References: Date: Mon, 16 Mar 2015 17:05:21 +0800 Message-ID: To: Pierre Joye Cc: 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 5:00 PM, Pierre Joye wrote: > Hi, > > On Mar 16, 2015 4:29 PM, "Xinchen Hui" wrote: >> >> Hey: >> >> The most unaccept feature in current STH thing(v.5.0) is this. >> >> acutaly, I believe in most applications, they will still keep this >> off.. >> >> so why we introduce such thing? >> >> beside this, I have a question, which is not explained in the RFC: >> >> lib.php >> > declare(strict_types = 1); >> function add(int $a, int $b) { >> } >> ?> >> >> assuming lib.php is a thrid part library which I want to use it >> in my project. >> >> but I use whole weak types in my project.. >> >> thus I simply call add by: >> >> > >> add($_GET['a'], $_GET['b']); //recoverable error since all >> input in _GET _POST is string by default >> >> ?> >> >> 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. >> >> is that right? > > You got the answer but one thing bothers me a lot right now. > > How did you vote against this rfc while missing the core point of it (after > actually having a strict mode)? as I said, " acutaly, I believe in most applications, they will still keep this off.. so why we introduce such thing? " I don't like strict_types at all.. the question I asked is just want one of my concern is not ture, or not oversight by others. thanks -- Xinchen Hui @Laruence http://www.laruence.com/