Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78752 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 12560 invoked from network); 5 Nov 2014 22:15:52 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Nov 2014 22:15:52 -0000 Authentication-Results: pb1.pair.com header.from=smalyshev@sugarcrm.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=smalyshev@sugarcrm.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain sugarcrm.com designates 108.166.43.91 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 108.166.43.91 smtp91.ord1c.emailsrvr.com Linux 2.6 Received: from [108.166.43.91] ([108.166.43.91:48299] helo=smtp91.ord1c.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 64/63-27106-691AA545 for ; Wed, 05 Nov 2014 17:15:51 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp20.relay.ord1c.emailsrvr.com (SMTP Server) with ESMTP id 8808B802DA; Wed, 5 Nov 2014 17:15:48 -0500 (EST) X-Virus-Scanned: OK Received: by smtp20.relay.ord1c.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id EF39F8024B; Wed, 5 Nov 2014 17:15:47 -0500 (EST) X-Sender-Id: smalyshev@sugarcrm.com Received: from Stass-MacBook-Pro.local ([UNAVAILABLE]. [74.85.23.222]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA) by 0.0.0.0:465 (trex/5.3.2); Wed, 05 Nov 2014 22:15:48 GMT Message-ID: <545AA193.6060606@sugarcrm.com> Date: Wed, 05 Nov 2014 14:15:47 -0800 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Dmitry Stogov CC: Andrea Faulds , Levi Morrison , internals , Nikita Popov References: <5B1B375C-328B-40BD-B715-8EDA158B44CE@ajf.me> <545A912A.2050202@sugarcrm.com> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC][Vote] Return Types From: smalyshev@sugarcrm.com (Stas Malyshev) Hi! > No, classes are not loaded for type checks, since it would be pointless > - if the class is not loaded, you could not have a value of that type, > so if the class is not present, the answer is "no". > > > It's not true anymore, with this proposal. This is not good. The base premise of type checks always was if you don't use them, they are basically free - you don't load the classes, you don't do any work, until you actually need them, and by then your class is supposed to be already loaded, so again it's not costly. But if just declaring a type could trigger loading of code, this may significantly increase the footprint and loading time for classes that have many options but only use some of them at the time. Also, it is kind of weird that arguments require exact match but return types do not. Not that we care for consistency anymore... -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/