Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:87112 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 48251 invoked from network); 11 Jul 2015 19:25:27 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Jul 2015 19:25:27 -0000 Authentication-Results: pb1.pair.com header.from=derokorian@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=derokorian@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.172 as permitted sender) X-PHP-List-Original-Sender: derokorian@gmail.com X-Host-Fingerprint: 209.85.212.172 mail-wi0-f172.google.com Received: from [209.85.212.172] ([209.85.212.172:38395] helo=mail-wi0-f172.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 54/22-32599-1AD61A55 for ; Sat, 11 Jul 2015 15:25:24 -0400 Received: by wicmv11 with SMTP id mv11so34667050wic.1 for ; Sat, 11 Jul 2015 12:25:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=BcnV/Pkom+EH/OtwbqgZ5rqkYZYExlzRznzuG63mo/U=; b=bPvtFCZQA/8eAS+0nijmPNF18VyB8kZjPuWmBsfgzyBrgH9k1ohmVw4Tw+C3glta5R sMoJZmu/1Oow80jDrErnJOP+bqIiW3cYep4ipTE0DxLQxoXXvQFm/l3zwWzkl17PZDBy egQiZfNIQD6YvvHGetGg+deuAUOfOa9Gzl9Sduqj34ZN1L1t0MSXOzF3jmVoGKggCYkp ZQfh6xVhnWJKbPzsvCNksrrm0V1quI8jsVOeSeOvfxCCvqqpB0q6kXxcMRlRqJB4On7N DSa9W7c3aKFBTbu7SnYx8XOaPCk7mZB3QHEfY7V0LrKITCSaXa742TKBPZV9MPUeZ8xH py5g== MIME-Version: 1.0 X-Received: by 10.194.89.5 with SMTP id bk5mr53528927wjb.144.1436642718526; Sat, 11 Jul 2015 12:25:18 -0700 (PDT) Received: by 10.28.188.70 with HTTP; Sat, 11 Jul 2015 12:25:18 -0700 (PDT) In-Reply-To: <55A16375.4000707@php.net> References: <55A16375.4000707@php.net> Date: Sat, 11 Jul 2015 13:25:18 -0600 Message-ID: To: Sebastian Bergmann Cc: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=089e010d8400e83463051a9e7284 Subject: Re: [PHP-DEV] PHP7 and types From: derokorian@gmail.com (Ryan Pallas) --089e010d8400e83463051a9e7284 Content-Type: text/plain; charset=UTF-8 On Sat, Jul 11, 2015 at 12:41 PM, Sebastian Bergmann wrote: > Am 11.07.2015 um 19:53 schrieb S.A.N: > > It will be useful for autocomplete in IDE > > That argument is bogus since proper IDEs (PhpStorm, fex.) leverage > docblock annotations for that already. > > Agreed. I don't know any IDE meant for PHP that doesn't respect docblock declarations. I think the benefit comes more in being able to make a property public, and still have control over its type. Currently the only way to do it is to have your property be private and use public get/set method(s) instead. IE: class foo { public int $bar; } -- vs. -- class foo { private $bar = 0; public function getBar() : int { return $this->bar; } public function setBar(int $val) { $this->bar = $val; } } Granted its still far less verbose for scalar types than in the current 5.x world where you have to have your own type checks as well. -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --089e010d8400e83463051a9e7284--