Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:83159 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 57824 invoked from network); 19 Feb 2015 09:06:45 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Feb 2015 09:06:45 -0000 Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 209.85.220.175 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 209.85.220.175 mail-vc0-f175.google.com Received: from [209.85.220.175] ([209.85.220.175:50385] helo=mail-vc0-f175.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id DF/B4-22021-3A7A5E45 for ; Thu, 19 Feb 2015 04:06:44 -0500 Received: by mail-vc0-f175.google.com with SMTP id hq12so696739vcb.6 for ; Thu, 19 Feb 2015 01:06:40 -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=fp11sbLjV6HzCF/H3Izml/oHjKVaxvNJTqqNoh06v34=; b=cr0Dz4gL4aqjSCzzj8S0xaVwAVqoG2g6Tp7wZRzAkgrOGiqCWBMOP38g0TkpJXKOJu sQrsC+3c27jXNBjKKhN4ZjkZSYVeycwx98e1FiC0CVo+1pTxutmYCPeL6+B5j1yWr3+3 zvG71VxJIH5ePoYYR7x/O8WahzE6VBvF0jFVKKHDbZ18LSQP1jEn7uoQQweevu97dpv1 Za5fP5V60F0Lb6bd8KApYIrpj6zloWR63gH8c9FFnIUuGwEGfOkcC4TXMwJrkhPO8IcB 9jxkCoqBYf+XBhhRrjJc0CLOLblzXBmmi6PXaSnvgiK4PGp8HGq9cbh3+kU3m/mx8zDt 3cFw== X-Gm-Message-State: ALoCoQnF1M8XLOAgUJVHwRq9C4/cVprDBixHkRQu6AQA7LvsMV4Wm8nDlPCUrzppnLC5jfR/b9K+3E8yli6YMI4X57oV4eCh/puXQJmDXHkpSSlWueWz71v+IiNVrRIxBciIrLQI8G+p1/gQSULv/z5FMkDD2xSfvQ== MIME-Version: 1.0 X-Received: by 10.220.185.193 with SMTP id cp1mr1143700vcb.80.1424336800774; Thu, 19 Feb 2015 01:06:40 -0800 (PST) Received: by 10.52.74.73 with HTTP; Thu, 19 Feb 2015 01:06:40 -0800 (PST) In-Reply-To: References: Date: Thu, 19 Feb 2015 13:06:40 +0400 Message-ID: To: Anthony Ferrara Cc: Leigh , "internals@lists.php.net" Content-Type: multipart/alternative; boundary=089e015386100d11c7050f6d4106 Subject: Re: [PHP-DEV] [RFC-Discuss] Scalar Type Declarations v0.5 From: dmitry@zend.com (Dmitry Stogov) --089e015386100d11c7050f6d4106 Content-Type: text/plain; charset=UTF-8 On Thu, Feb 19, 2015 at 12:50 AM, Anthony Ferrara wrote: > Leigh, > > >> Internal Functions Like ceil() Return Unexpected Types > > > > My opinion is that functions should return sane types for their > > intended purpose, and functions that do not should be "fixed". > > I agree 100%. I just think that's outside the scope of this proposal. > > >> Static Analysis Is Possible With Weak Declarations > > > > The advocacy of allowing `accepts_float(returns_int());` doesn't help > > the cause of static analysers in strict mode. > > Java does exactly this and is statically analyzable. So...? > PHP is not a language for static analyzes or verification!!! Strict typing shouldn't be done on language level. it may be implemented as a custom verification extension, but please, don't break the language itself. Thanks. Dmitry. > > > Still no mention of a way to enable strict by default. So lets try > > some different rationale. If I personally want to develop in strict > > mode, I can do that with this proposal, I can add a declare to the top > > of every file and be as strict as I like. However not everyone else is > > going to want to use my code in strict mode, so they will have to go > > and remove some/all of those strict declarations. (Lets take callbacks > > being evaluated in the context they are called rather than the one > > they are created in). I would like a way of enabling strict by > > default, immutable to scripts so that users cannot be forced into this > > mode, and lets the radicals and the weaklings* play together in > > harmony. > > I missed that discussion point, so I've just added it: > > https://wiki.php.net/rfc/scalar_type_hints_v5#why_not_add_an_ini_setting_for_default_mode > > > For the rest of the RFC, I either agree with or have no strong > > opinions about the points raised. > > Thanks for the input :-) > > Anthony > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --089e015386100d11c7050f6d4106--