Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:81551 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 63165 invoked from network); 2 Feb 2015 07:02:08 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Feb 2015 07:02:08 -0000 Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 209.85.220.182 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 209.85.220.182 mail-vc0-f182.google.com Received: from [209.85.220.182] ([209.85.220.182:46737] helo=mail-vc0-f182.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 35/D0-58765-CE02FC45 for ; Mon, 02 Feb 2015 02:02:05 -0500 Received: by mail-vc0-f182.google.com with SMTP id kv19so14066967vcb.13 for ; Sun, 01 Feb 2015 23:02:01 -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:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=L2GWDlDCJ7uXNQDnejJuAYWBKPSWQ/2uFIswkx7i3GE=; b=FiWRAP/xK2kW01jz7X1xNDZP1o/qyeWecl//f/I7qkpE/4xnyL/MF9HHsEu8y+jczS fopTb2drn3TGcv7WfMH3ADg61zXdEWRcCLsBKnzCIM5lzITiOsgg3imUS9HkWo1jR73R M8HskEH0PlkszBIaqaoWMQy4Ru0KTo1OXGip3MW9lM4vQBCs7TxB7uwe2SHPk4FoycKW GRTvlduQn29Y03KwJd/w96r02+vtOCh2goj8YhMGH7HEXotr/ihZmVVXoHQtk7bzUYEK FpOAXXW4akWIs9pJwgfZ2smRZjgKfnqppalu4QjtIEf/0GTNe81DoYDg5N95/DWet6iI 7KtQ== X-Gm-Message-State: ALoCoQliXKwSZqEGVGqyzt9d4Gx4brIKyS8akGW05I/YZbcVKqL57yEvdAIuDroBBHEAIagaCZJj+JZrsoeFzeDZPuhdBTXTvm20hyfKh8qudjoXAw7+VCgJ+uweQiwEDY5IZN8Kxr5RSXOaueN36islQfezR1/fcw== MIME-Version: 1.0 X-Received: by 10.52.103.75 with SMTP id fu11mr9299362vdb.5.1422860521235; Sun, 01 Feb 2015 23:02:01 -0800 (PST) Received: by 10.52.74.73 with HTTP; Sun, 1 Feb 2015 23:02:01 -0800 (PST) In-Reply-To: References: <8DCD1B72-C81D-499E-B455-E4A042CD76E6@ajf.me> Date: Mon, 2 Feb 2015 11:02:01 +0400 Message-ID: To: Andrea Faulds Cc: PHP Internals List Content-Type: multipart/alternative; boundary=047d7b86d990eeffd9050e158749 Subject: Re: [PHP-DEV] [RFC] Scalar Type Hints v0.2 From: dmitry@zend.com (Dmitry Stogov) --047d7b86d990eeffd9050e158749 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable As I already told, in my opinion, version 0.1 was the perfect solution that fit into PHP semantic very well. declare(strict_types=3D1); - is really weird solution. It changes type hinting behavior per file scope, so, just to try strict type hinting in a big project, people will have to change every single PHP file. From the RFC text, I didn't completely understand, if declare() affects call site or declaration. Will we able to call the same function using weak type hinting from on file and with strict from the other? "The strict type checking mode also affects extension and built-in PHP functions", sin(1) - error !!! Strict type hinting is not suitable for PHP by definition (as a weakly typed language), however, I see, it may be useful in some cases. I would prefer to have "weak" types at first, then think about introducing ability to switch to "strict" type hinting in context of use-cases. Thanks. Dmitry. On Mon, Feb 2, 2015 at 2:49 AM, Andrea Faulds wrote: > Good evening, > > The RFC has been updated to cover return types, since Levi=E2=80=99s Retu= rn Types > RFC has passed. The patch is a work in progress: it works, but lacks test= s > for return types. > > Version 0.3 of the RFC can be found here: > https://wiki.php.net/rfc/scalar_type_hints > > Thanks! > -- > Andrea Faulds > http://ajf.me/ > > > > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --047d7b86d990eeffd9050e158749--