Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:65062 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 99949 invoked from network); 21 Jan 2013 23:37:18 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Jan 2013 23:37:18 -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.215.177 as permitted sender) X-PHP-List-Original-Sender: cryptocompress@googlemail.com X-Host-Fingerprint: 209.85.215.177 mail-ea0-f177.google.com Received: from [209.85.215.177] ([209.85.215.177:49419] helo=mail-ea0-f177.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 23/61-20901-C21DDF05 for ; Mon, 21 Jan 2013 18:37:17 -0500 Received: by mail-ea0-f177.google.com with SMTP id n13so2644758eaa.22 for ; Mon, 21 Jan 2013 15:37:12 -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=DCvuVly7p+y86RdxpzgYjgFuXKZ8n37sd+YBxp/dMQk=; b=mvlj46fFvnNLaKSq+8ztT08biHFqxkurA5O8IVHLe8+G7qnvyqRoVXKecVSjhsooqY PeNEGZpd6B/mpvJPkWM1aCTodpriVFvSUa0HzzxZMnRdmWrbrij2ybWfDjOHShhtwb4Y E05PlresWLZ49r2hSDOru+WKefnDSzL6Llpy5fm8PdNdDLGXnNuirDp4NL1KcqsF4x3X Y7mI//ndaw9fmb2sqLO+1Dg1gX3lk8nSJWtEDJDbUSzr6uKAn7WSq0BvSt8DycC/rfpS t1XAPTzkCAzcqpvzC5einPW2OATQQNTOuOQ3UOXlMJ3hVW44wiaN/Sxj28GVe4fLXNzA /niw== X-Received: by 10.14.194.195 with SMTP id m43mr65811012een.44.1358811432683; Mon, 21 Jan 2013 15:37:12 -0800 (PST) Received: from [192.168.1.111] (mnch-5d86e694.pool.mediaWays.net. [93.134.230.148]) by mx.google.com with ESMTPS id e2sm24451199eeo.8.2013.01.21.15.37.11 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 21 Jan 2013 15:37:11 -0800 (PST) Message-ID: <50FDD0D1.4010501@googlemail.com> Date: Tue, 22 Jan 2013 00:35:45 +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: PHP internals References: <50FDC733.209@googlemail.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [VOTE] Alternative typehinting syntax for accessors From: cryptocompress@googlemail.com (Crypto Compress) Am 21.01.2013 23:59, schrieb Nikita Popov: > Sorry if it wasn't clear: The nullability stuff only applies if a typehint > is used. If no typehint is used, then you can freely assign null, regardless > of whether or not you have the "= null" in the declaration > (no typehint = everything's valid). "public $foo;" will continue to behave > exactly the same way it did before :) > Nikita Nonetheless there is the same complication. I like to test "half-instantiated" objects (maybe this is common/best practice?): a = $a; $this->b = $b; } } // test only a $c = new C("foo", null); // fail var_dump($c->a === "foo"); // test only b $c = new C(null, "foo"); // fail var_dump($c->b === "foo"); ?> So if i want typehinting, i have to add "= null" without any real benefit as for testing. Current behavior doesn't restrict NULL values. Why change this? "method-like optional values"?