Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:93225 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 32163 invoked from network); 11 May 2016 10:40:35 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 May 2016 10:40:35 -0000 Authentication-Results: pb1.pair.com header.from=quim@kalpe.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=quim@kalpe.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain kalpe.com from 209.85.213.174 cause and error) X-PHP-List-Original-Sender: quim@kalpe.com X-Host-Fingerprint: 209.85.213.174 mail-ig0-f174.google.com Received: from [209.85.213.174] ([209.85.213.174:36312] helo=mail-ig0-f174.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 03/77-28272-02C03375 for ; Wed, 11 May 2016 06:40:34 -0400 Received: by mail-ig0-f174.google.com with SMTP id lr7so31382942igb.1 for ; Wed, 11 May 2016 03:40:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kalpe-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=pddfP2lzkd/jHlCj/UplCG6P1RCMAIAb9INhmnITig0=; b=yrV1gSvTL9ZqWfMzVaPNLEXkuBJjL2zAUqC9h8OFNMk6lEvz7ObItIjIRnLYX0ZsXA LEXuxv7q5ZNAVVJNxGvNO8rDbIXLeSLNvhlNVBvh41/pZVkf79WOJEmBD2F3S3ig7LNv lz1DeWjfsVDatfIISJDMFMgcTjrc1defJNpnaSeogKzA+LA0fPcPRccL9CvC8MlE0IzV aqKWmjXzGjCewFukLPCUeV94o6hogikyEQNRrzn0gTv7fYtC7Hhnk1goaqkqCYC3SuKH 72cz5OuBymP7KyiNF6zjzRPs5u1opETMRejkV9aX42oAG6o9UfEluxcF24qUbae0i5sn A3QQ== 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; bh=pddfP2lzkd/jHlCj/UplCG6P1RCMAIAb9INhmnITig0=; b=i3Fy/uf9vA2UmaVGA7x81Z40zxddT4hrSFHpzJ6trVgDHii8Ry9EQYLGEXMJAqC6W6 fAofoIUWraBWUSa70brLlr0NbW0ap4p2xS9kUfpxgzOw2hRBCMLIjBdw2/igk2Ii6Krn Ccw2fmmhHqkwd2hWLDHYO63cWKSlMS3Qxdvh+SvCqxcLAhWWQRQUYMUekU0hP7/imPEo 7qw+fa/nQKM6q8+sjcQZj7UzjsMO89ngXNbpEYmIc7elnmF/eFvWqHcod0pV5FoxcShq 2qlFW5Tkrhv+0xzAUsRq+nxpjj79bbOg0MNCsbW2oJLrZE4N3JTtX1520LK7N9vOdUMp ZGJQ== X-Gm-Message-State: AOPr4FV6mFRWyHjk27p+etL/d94oVGNvgTgDSaAtkp19Rk8eKNb645dV3yG5VG2BYJ4ad/psDGIQrzpzQDRgHA== X-Received: by 10.50.30.228 with SMTP id v4mr2621922igh.85.1462963230311; Wed, 11 May 2016 03:40:30 -0700 (PDT) MIME-Version: 1.0 Received: by 10.36.220.194 with HTTP; Wed, 11 May 2016 03:40:10 -0700 (PDT) In-Reply-To: <573308EC.70502@lsces.co.uk> References: <573232DB.8030209@lsces.co.uk> <573308EC.70502@lsces.co.uk> Date: Wed, 11 May 2016 12:40:10 +0200 Message-ID: To: Lester Caine Cc: internals Content-Type: multipart/alternative; boundary=047d7ba98440a9a92c05328eab3c Subject: Re: [PHP-DEV] Re: [RFC][VOTE] Nullable Types From: quim@kalpe.com (Quim Calpe) --047d7ba98440a9a92c05328eab3c Content-Type: text/plain; charset=UTF-8 On Wed, May 11, 2016 at 12:26 PM, Lester Caine wrote: > On 10/05/16 21:26, Levi Morrison wrote: > > It can affect the results. > > > > function foo(?Foo $param) {} > > > > If any code out there is calling foo with null then that code will now > > break if you remove the question mark. > > Cart before Horse comes to mind ... > > If the function is going to fail if you pass in a null ... you check for > the null before calling it. OK the '?' is a flag that you need to do > that, but you really need proper documentation as to just what Foo > expects. If I've handled the null case situation, the ? is redundant? > function foo(?Foo $param) Is not going to fail if you pass a null, precisely "?" allow you to pass a null I'm still failing to see an overall picture of what people are trying to > achieve. Adding errors means that those errors need to be handled. If > the function gets a 'null' then there is a reason, and either the > function should not have been called ... workflow failed ... or the > function should simply handle the 'null' case. If the '?' throws an > error the workflow is broken after the event where a user code warning > would be more helpful. > > -- > Lester Caine - G8HFL > ----------------------------- > Contact - http://lsces.co.uk/wiki/?page=contact > L.S.Caine Electronic Services - http://lsces.co.uk > EnquirySolve - http://enquirysolve.com/ > Model Engineers Digital Workshop - http://medw.co.uk > Rainbow Digital Media - http://rainbowdigitalmedia.co.uk > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --047d7ba98440a9a92c05328eab3c--