Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:93226 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 33593 invoked from network); 11 May 2016 10:42:22 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 May 2016 10:42:22 -0000 Authentication-Results: pb1.pair.com header.from=mike.php.net@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=mike.php.net@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.45 as permitted sender) X-PHP-List-Original-Sender: mike.php.net@gmail.com X-Host-Fingerprint: 74.125.82.45 mail-wm0-f45.google.com Received: from [74.125.82.45] ([74.125.82.45:36579] helo=mail-wm0-f45.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C8/C7-28272-D8C03375 for ; Wed, 11 May 2016 06:42:22 -0400 Received: by mail-wm0-f45.google.com with SMTP id n129so213798458wmn.1 for ; Wed, 11 May 2016 03:42:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to; bh=dKtE3O7sTc/pNMEBmuqWwyfsFM3TLrSgAF3F1nLLo3c=; b=hs5x4o4ahTYKIHV7aeoyxWPwg2tGbvDmhxzuMoLrD2ciJYHeKcrkN60jNY1/zEOKvw 9NDpJlrWLUvhnut8rxq66MzVCmQxZdX7m6OFfWrgGGXlLAZFhiv5MV8Cxy7UuMfrtVBJ LCDSw1jgvbsqergpy1CHZ9a0QuitYGxgzzJIhZL1Tjzr7ExP5vuPIFANN3jDCGgqs08p WFSG9QE9YH6K/k5xfoNWv4Dz7oHJNQWNKm10qmxyUSKQWO9FDFKuq1DdRX1naSBXpqDJ zZEB5ECYhtH1n+h5en4DT+AIqS82FE+3qHlC1cIfZeMNexCwkhQ51AZGvfQ5e4Eb9tM8 HI/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:to:references:from:message-id :date:user-agent:mime-version:in-reply-to; bh=dKtE3O7sTc/pNMEBmuqWwyfsFM3TLrSgAF3F1nLLo3c=; b=IdI7Qx/Y9pvt1PhZfIJgR20YRdkQEacHSaj9eAzDhkdMebJcO2IQ2gFlV1AVYZcqFq iasrgZBF1nAFoONRWfJK3WB1I57YS6AS9vNzNKXgi8SaDNm2ohM4gnlNMV5ZpHA1lAm3 nzEeM1jj0uk0CfIxm2q7+/MGUNdY7l1vrDB3rBOtcwdAzu0DVtEIBRHK+FACaCZxSzML WPk5H8waJcZVnpaxaT2fgQ2Z8HteK5ts4UqObA/Rb1yKft8ZmYzhHyqVQ+aT6wOB/wGb UJS4Uvo47ud6FK9rPBCVCn/jnaoFr3ZISOZv3glMV5GEn0voBsf1E2gqTuGjveXGGIEj SCHw== X-Gm-Message-State: AOPr4FVYGlRcLiaTzMULA5WTcrHte4LVcrQD8y/0Xjdb3/UPchIygvJVkIl2VugIvirMfQ== X-Received: by 10.28.178.129 with SMTP id b123mr16176524wmf.2.1462963339227; Wed, 11 May 2016 03:42:19 -0700 (PDT) Received: from [192.168.2.120] (89-104-28-113.customer.bnet.at. [89.104.28.113]) by smtp.googlemail.com with ESMTPSA id o129sm34839041wmb.17.2016.05.11.03.42.17 for (version=TLSv1/SSLv3 cipher=OTHER); Wed, 11 May 2016 03:42:18 -0700 (PDT) Sender: Michael Wallner To: internals@lists.php.net References: <573232DB.8030209@lsces.co.uk> <573308EC.70502@lsces.co.uk> Message-ID: <57330C7D.5070901@php.net> Date: Wed, 11 May 2016 12:42:05 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.1 MIME-Version: 1.0 In-Reply-To: <573308EC.70502@lsces.co.uk> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="3tSabhuVsDkhjVW4fhiw08rB3ESSemHkS" Subject: Re: [PHP-DEV] Re: [RFC][VOTE] Nullable Types From: mike@php.net (Michael Wallner) --3tSabhuVsDkhjVW4fhiw08rB3ESSemHkS Content-Type: multipart/mixed; boundary="eCPWp0r3XgloCFPTqGbAqTwfFkD001HWq" From: Michael Wallner To: internals@lists.php.net Message-ID: <57330C7D.5070901@php.net> Subject: Re: [PHP-DEV] Re: [RFC][VOTE] Nullable Types References: <573232DB.8030209@lsces.co.uk> <573308EC.70502@lsces.co.uk> In-Reply-To: <573308EC.70502@lsces.co.uk> --eCPWp0r3XgloCFPTqGbAqTwfFkD001HWq Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 11/05/16 12:26, 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. >=20 > Cart before Horse comes to mind ... >=20 > If the function is going to fail if you pass in a null ... you check fo= r Why do you assume it'll fail? > 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? >=20 > I'm still failing to see an overall picture of what people are trying t= o > 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. >=20 function foo(?Foo $param) is equivalent to function foo(Foo $param =3D null) except the former does not provide a default, i.e. it requires an argument being passed to a call to foo(). --=20 Regards, Mike --eCPWp0r3XgloCFPTqGbAqTwfFkD001HWq-- --3tSabhuVsDkhjVW4fhiw08rB3ESSemHkS Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBCgAGBQJXMwx9AAoJEEgOPhSwpMfHwVEIAIo4bvkwbyw3YGUoLJ0JXUSS 9LkI/ebE4jdjZUkV8wWbX5VXd4NZ37h7YKDkK5jANSqvUqoiYJctYTreHDH5wbNd k+inMIHmyZ/cAoVKYMcRY7PCjZTPgL+riBr9jlF8d9DGDwU7gIAVitd2EoBLStws nJflC7p4curLC4+LPZq/bVWFXjWJ5emChZsD4JMem51lEPZ1JcJT/9ZzFa6Ytiwj +UQZay5X4V3NCqNj6nmkclDhLBzUl7RvmQqErvSmQZ0S4fzwMBsJV5e1D8qOdGWE +CL1PiC45Hz9kmBdoPpMSfFyiHJ472lMbdUDeXr1WoH90aCUKDV2bKTnGkUM1k0= =7zd6 -----END PGP SIGNATURE----- --3tSabhuVsDkhjVW4fhiw08rB3ESSemHkS--