Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:65138 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 67552 invoked from network); 24 Jan 2013 01:12:58 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Jan 2013 01:12:58 -0000 Authentication-Results: pb1.pair.com smtp.mail=morrison.levi@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=morrison.levi@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.219.54 as permitted sender) X-PHP-List-Original-Sender: morrison.levi@gmail.com X-Host-Fingerprint: 209.85.219.54 mail-oa0-f54.google.com Received: from [209.85.219.54] ([209.85.219.54:41739] helo=mail-oa0-f54.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4A/20-65404-A9A80015 for ; Wed, 23 Jan 2013 20:12:58 -0500 Received: by mail-oa0-f54.google.com with SMTP id n9so9248295oag.13 for ; Wed, 23 Jan 2013 17:12:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=n59PCaG8Ogq0QEfBfRfDCsfku9x3kQoVqpaG+4uYmUY=; b=zZwJ9Jvjnf+NpMF1jhUGbDE9W0DWLBgWt1O/DUuVnhALkzVjzjjCH2DxjSg1ACBTOs 6y204X4P4CMV93nthsFQn6vaxdMhFHL6fFuYDg9CZv1WLrCMHQmmCngS8pQ5uhFIWsjl yYKFfmWkvuGEhbAqSFecSvsWtdfZ3SC4Ro6gkfEdKVICC8Zk8w1znTsCF2ZIlZVyDDUY 6PAwgj2PkZyUt/Ly4Mt/izDw3eYXUHPPblbKv8R4RYT/L9Gm7FYDj+EpVxLkbP8F5QRP tEj8ZuBE/EcQHE+ZezWiN3qKIaML1FuhBlfR0I9sfqGchi0MmiN5P9dqcPNm+npjQV3b sQYw== MIME-Version: 1.0 X-Received: by 10.182.177.72 with SMTP id co8mr132898obc.53.1358989974760; Wed, 23 Jan 2013 17:12:54 -0800 (PST) Received: by 10.76.82.234 with HTTP; Wed, 23 Jan 2013 17:12:54 -0800 (PST) In-Reply-To: <51005B7F.6060209@googlemail.com> References: <510038C9.5000900@mrclay.org> <51005B7F.6060209@googlemail.com> Date: Wed, 23 Jan 2013 18:12:54 -0700 Message-ID: To: Crypto Compress Cc: internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] C# properties vs. accessors RFC From: morrison.levi@gmail.com (Levi Morrison) >> I also don't like the `?` for `nullable`. Just stick with PHP >> convention and do: >> >> class Foo { >> public Bar $bar = NULL; >> } > > > There is no such PHP convention. The PHP convention is *not restrict type* > (+"loosely typed" addons). > So NULL is automatically allowed. For properties, yes, but the idea it stems from is type-hints. Given the following type-hint, passing a null is not allowed: class Foo { function bar(Bar $bar) {} } Whereas in the following NULL is allowed: class Foo { function bar(Bar $bar = NULL) {} } This is what I mean by the PHP convention for allowing NULL.