Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:71188 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 35614 invoked from network); 16 Jan 2014 16:39:41 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Jan 2014 16:39:41 -0000 Authentication-Results: pb1.pair.com smtp.mail=php@tutteli.ch; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=php@tutteli.ch; sender-id=pass Received-SPF: pass (pb1.pair.com: domain tutteli.ch designates 80.74.154.78 as permitted sender) X-PHP-List-Original-Sender: php@tutteli.ch X-Host-Fingerprint: 80.74.154.78 ns73.kreativmedia.ch Linux 2.6 Received: from [80.74.154.78] ([80.74.154.78:47634] helo=hyperion.kreativmedia.ch) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AB/62-21406-B4B08D25 for ; Thu, 16 Jan 2014 11:39:40 -0500 Received: (qmail 4016 invoked from network); 16 Jan 2014 17:39:37 +0100 Received: from heim-032-99.raab-heim.uni-linz.ac.at (HELO RoLaptop) (193.171.32.99) by ns73.kreativmedia.ch with (AES128-SHA encrypted) SMTP; 16 Jan 2014 17:39:37 +0100 To: "'Jannik Zschiesche'" Cc: "'Philip Sturgeon'" , "'Marco Pivetta'" , "'Kristopher'" , References: <001301cf1227$6d082ab0$47188010$@tutteli.ch> <002d01cf1234$01e6dc60$05b49520$@tutteli.ch> <004c01cf123d$35730870$a0591950$@tutteli.ch> <29D5E17DED4340E4AB756A336E0D3E80@apfelbox.net> In-Reply-To: <29D5E17DED4340E4AB756A336E0D3E80@apfelbox.net> Date: Thu, 16 Jan 2014 17:39:34 +0100 Message-ID: <001e01cf12d9$8a52f750$9ef8e5f0$@tutteli.ch> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQGahXeLh/KZbd8XAeJ9KP0Xitay+AEcU2WhAaqmqGABFinRgAGUH60GAsS5wSoDHy62oAKq0EPNAioa7hWab1XT8A== Content-Language: de-ch Subject: RE: [PHP-DEV] Introducing "Array Of" RFC From: php@tutteli.ch ("Robert Stoll") > if you pass an array which mixes both objects and null and you want to = work on the objects, you still have to do the checks > yourself: I agree, in this case it would be useful if Foo[] excludes members which = are NULL. I guess I did not make it clear enough what I tried to point = out. A new feature should not just work for some use cases because the = majority of people would use it this way but also for other use cases as = long as they are valid. So my point was that the RFC has to consider both cases, once excluding = NULL and once with NULL as valid entry. As long as it doesn't it is = incomplete IMO. Andrea made a nice suggestion for the syntax and I would go for it: > > function foo(Bar? $a) {} // $a is Bar/null > > function foo(Bar?[] $a) {} // $a is array of Bars/nulls > > function foo(Bar[]? $a) {} // $a is array of Bars, or null > > function foo(Bar?[]? $a) {} // $a is array of Bars/nulls, or null