Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:92338 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 62639 invoked from network); 15 Apr 2016 16:10:41 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Apr 2016 16:10:41 -0000 Authentication-Results: pb1.pair.com header.from=morrison.levi@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=morrison.levi@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.65 as permitted sender) X-PHP-List-Original-Sender: morrison.levi@gmail.com X-Host-Fingerprint: 209.85.220.65 mail-pa0-f65.google.com Received: from [209.85.220.65] ([209.85.220.65:34231] helo=mail-pa0-f65.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 9F/05-29891-08211175 for ; Fri, 15 Apr 2016 12:10:40 -0400 Received: by mail-pa0-f65.google.com with SMTP id hb4so10064556pac.1 for ; Fri, 15 Apr 2016 09:10:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc; bh=BDepdBnBnTzCW/tumuGbEEFK1kw9Q5zeNjK7HL05xTc=; b=bAQlrIkV9GouoDij7qFosuktMdIHmQEX9cu+Oq9Knb4gtGaZwnA4gbd5mGgL2T1+tQ +yiUznmA7TM7rR9Iu86jFf08JLS+eYq/DMgP8/24Wv+bI8LExAYRvytHXIChPeKUpQV0 fIJiaJGoC5IAxPn7e5i5il2/rADaHPGgF2wQHqPO4593HrgnPiS31sX4tWYsf+8KYLpE VIISt2Nam3qRMx5VjUlyrjTy/jhM7cCXI2NE8a+djymY0HStZL8jng01K7Q1THOYb1UL hFSfbXLHmlldiiNoHp1EqINs59sCBZP1MCmTB3ILL9YrZJlmEZ+hin0QWEQ3bETTuda7 xBmA== 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; bh=BDepdBnBnTzCW/tumuGbEEFK1kw9Q5zeNjK7HL05xTc=; b=CJT8hqsyYDbp64a4YsENgPF4HQqyV06Y9ZBTRhkszLLWwmWxMBvcI7YyNeEHQxEIRo vAJ3HJds7EQBTlGtOuVX6WP7s/52839aFWS6tghtYSWsQmVcPK19R+vG5hqCoXn0gqp1 qBYJLKjK2wxOalX+MycC7I9yxJU2tFLC15+90Z4ju3vkqfAj0MlbvpRCqCof0wO+a4Gl BHBGaQxK6okp0mY2TNkmV66VFv5xL53MhKetiq/iE+6qTBcAL/1Rht8khRMW1BkyOqvN kgHVV4ov4AM8uXFCs8lODLuC/O3T5/iuW/7Ucbqes6t9ayMbtLWsh2PO8xYHxAdE3lLP BW8w== X-Gm-Message-State: AOPr4FW45JNq8SRCo+2lh2yW8IaE6FyGzvDa17PpaEV3S/Gfsjjf9FmZu2Zz3z2gLZuRduRmcWc6N+/HSQAAKQ== MIME-Version: 1.0 X-Received: by 10.66.232.4 with SMTP id tk4mr30804386pac.103.1460736637470; Fri, 15 Apr 2016 09:10:37 -0700 (PDT) Sender: morrison.levi@gmail.com Received: by 10.66.132.79 with HTTP; Fri, 15 Apr 2016 09:10:37 -0700 (PDT) In-Reply-To: <57110DC5.8000007@garfieldtech.com> References: <57103A46.6040803@garfieldtech.com> <5710BA79.5060108@lsces.co.uk> <57110DC5.8000007@garfieldtech.com> Date: Fri, 15 Apr 2016 10:10:37 -0600 X-Google-Sender-Auth: tGDqMq_kqO4nfT9YSVQ3GLF4Zbw Message-ID: To: Larry Garfield Cc: internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] [RFC] Nullable Return Type Declaration From: levim@php.net (Levi Morrison) > I'm not suggesting that we purge NULL from the language. That's > impractical/impossible. I'm suggesting we shouldn't soften the type system > added in 7.0, which discourages its use in most cases, as it should be. It is a common misconception I've heard several times now that union types is weakening or softening the type system. I want to reiterate that it is already possible to use multiple types. It is already done in the wild. It is done all over our standard library. The union types RFC just allows you to encode the specific types to be passed or returned. In other words it is aiming to make using the dynamic types of PHP safer by allowing you to explicitly write out the options. The Nullable Return Types RFC is basically arguing that the only useful union of types is `T | Null` and only for return types. I've already stated a few of my concerns with that belief and have not been convinced by the rebuttles to change my mind. Also, to specifically address a concern Larry had earlier about nullable types in general: > I am highly, highly sceptical about nullable parameters or returns, and frankly would rather they were not included in the language. Just to clarify: we already have nullable parameters because of a default of null. It's already in the language and people have asked many times for this functionality to be expanded to include return types. I should have kept a master list every time someone contacted me on github, email, twitter, etc about this so I could easily list them all as references in the relevant RFCs for demand for the feature.