Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:94890 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 53273 invoked from network); 7 Aug 2016 07:07:20 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Aug 2016 07:07:20 -0000 Authentication-Results: pb1.pair.com header.from=me@daveyshafik.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=me@daveyshafik.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain daveyshafik.com from 209.85.220.178 cause and error) X-PHP-List-Original-Sender: me@daveyshafik.com X-Host-Fingerprint: 209.85.220.178 mail-qk0-f178.google.com Received: from [209.85.220.178] ([209.85.220.178:34679] helo=mail-qk0-f178.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 59/2E-33134-62ED6A75 for ; Sun, 07 Aug 2016 03:07:18 -0400 Received: by mail-qk0-f178.google.com with SMTP id p186so172074684qkd.1 for ; Sun, 07 Aug 2016 00:07:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daveyshafik-com.20150623.gappssmtp.com; s=20150623; h=mime-version:from:date:message-id:subject:to; bh=tQ5NSTOqB5Mk+YZCQMoeBVnVkbu/g+X7oVd6qrKoR8E=; b=EJwKkbbFheka7M100E6wS9qghGVFJKzab68d4mioUyG+Ya7+pZo2TeNzbBwLg4d7L7 wEAlrqtyYyo1VzCgAuHfABdioJdRiKHdD+JP/DYKWM9f0Zht/CSjIYWSFkiFpoBMNL/f gyH9zbgMjyXhDq0GkdGJaQRPD1gtdEo+96GfWi7axukBY4LkuaU9askFHvH2GMP3Gtm5 lKFEtGP3/tsNpajkzS/W/00aRNHeEHAvSFjoaJp/Vf9jzod9Rw3LRxMvwc0yunNfdddt RWMlH83tcWyLcKpA7Ldl8Hwg9C38ffI4AyAvRdsroTewDP+g9uNMHooQh9mGMIXJJOYO y3Nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=tQ5NSTOqB5Mk+YZCQMoeBVnVkbu/g+X7oVd6qrKoR8E=; b=eal3dpgYtBv8QKed433GNH+N3O2S15RvpNAKiqR72v1eCxcxVodqJtkrSQPjIJ+Fps bFhwi+J3c7GrYI53UWS2FHrVIY1QI2K7JKjQ+a5vzQc3I5spJ25ohhMkrBDECC5A3LPK L8P54yVXeKlT1vqNK/JltDp5gGkkVW7VGHB5+zhg1Q/I4F8h3UVytJUga8YZHb9Bt5vk /FEfvh/sFOj060+xMXRLgGB0lk7fLR1OJdFGCleayWEQQNP1noppgWw8TFMzXoAoRenZ hY4L8w3swcwdxUPwQ7NT1JZTIeBkqXK6kL3li/JKioIq55icX4xC0K3Z7UJ8ZYSJNP6q 37Mg== X-Gm-Message-State: AEkooutT5G8J7GFz0XANQ05YubrjkqvD5LqDaBScludfHweCI+Xo1GcOaCra68SzDyuPi1D6BiBhLje5JXtaZptV X-Received: by 10.55.95.66 with SMTP id t63mr20422939qkb.139.1470553635200; Sun, 07 Aug 2016 00:07:15 -0700 (PDT) MIME-Version: 1.0 Received: by 10.237.55.138 with HTTP; Sun, 7 Aug 2016 00:07:14 -0700 (PDT) Date: Sun, 7 Aug 2016 00:07:14 -0700 Message-ID: To: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=94eb2c0541fe0cafe8053975f378 Subject: Undocumented Nullable Return Behavior From: me@daveyshafik.com (Davey Shafik) --94eb2c0541fe0cafe8053975f378 Content-Type: text/plain; charset=UTF-8 Hi internals, In the nullable types we do not allow implicit return null/return with no value to fulfill a nullable type. - No return will result in a TypeError when executed - Return with no value will be an actual fatal error, which I believe is due to the fact it's not found at runtime, should be a TypeError or ParseError if possible? - Return explicit null is fine (as expected) See: https://3v4l.org/h6IYF I believe the first two are contrary to PHP's "null is always returned if nothing else is". OTOH, it makes sense as it's the entire reasoning behind return void vs return null. This behavior is completely undocumented in the RFC. It's definitely something we should make an explicit decision on for the language spec if nothing else. We should also make any decisions on this prior to beta3 in < 2 weeks. Thoughts? - Davey --94eb2c0541fe0cafe8053975f378--