Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:65147 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 17196 invoked from network); 24 Jan 2013 13:46:43 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Jan 2013 13:46:43 -0000 Authentication-Results: pb1.pair.com smtp.mail=cryptocompress@googlemail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=cryptocompress@googlemail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain googlemail.com designates 209.85.217.171 as permitted sender) X-PHP-List-Original-Sender: cryptocompress@googlemail.com X-Host-Fingerprint: 209.85.217.171 mail-lb0-f171.google.com Received: from [209.85.217.171] ([209.85.217.171:53084] helo=mail-lb0-f171.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0A/45-65404-24B31015 for ; Thu, 24 Jan 2013 08:46:43 -0500 Received: by mail-lb0-f171.google.com with SMTP id gg13so5549019lbb.2 for ; Thu, 24 Jan 2013 05:46:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=IWQoZ55t8HiYbOy/u/9HNs0tbU7KViuwTuLPZLB5wHI=; b=JJ40rxye4kby/wj5/M7+m2YvBCY5m9REwXuyT765Aq/YaFJqSnwcuyqTFBWm7ImO+A U2X2FhNFRYcx+eowdWesjHlgYw4pSIJFt/85gKWcYPVfJs3g6Yk9wFg3bkiOduloRd8z fJzojwhZMsn/xNx9rpQJlUwh6nppZP57yxDWjwClcVSdG7L18zQBf4/Apjxq9Pv0Pox6 kWWeBL5QCk++Mk7ryXa9Iz53SHug56LPaWkw9X2WwK/7IDyfhFiYnC/0rfdJNF9xsT6d rPbbP+YeqOo+UygVm1boQM4YJZ+mjJc5TjodhAb1grnmfhQd6G1gPk1almohXcRjO/lY si7w== X-Received: by 10.112.13.162 with SMTP id i2mr809384lbc.76.1359035199273; Thu, 24 Jan 2013 05:46:39 -0800 (PST) Received: from [192.168.1.111] (mnch-5d85de30.pool.mediaWays.net. [93.133.222.48]) by mx.google.com with ESMTPS id gt13sm2882258lab.14.2013.01.24.05.46.37 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 24 Jan 2013 05:46:38 -0800 (PST) Message-ID: <51013AE2.1030804@googlemail.com> Date: Thu, 24 Jan 2013 14:45:06 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130107 Thunderbird/17.0.2 MIME-Version: 1.0 To: internals@lists.php.net References: <510038C9.5000900@mrclay.org> <51005B7F.6060209@googlemail.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] C# properties vs. accessors RFC From: cryptocompress@googlemail.com (Crypto Compress) Am 24.01.2013 02:12, schrieb 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. Hello Levi, you absolutly right. I was confused by the syntax. This properties are normal methods and should behave the same. Mixing "initialize-with-NULL" and "optional/nullable" is somewhat messy though. cryptocompress