Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:60406 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 25396 invoked from network); 1 May 2012 22:30:26 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 May 2012 22:30:26 -0000 Received: from [127.0.0.1] ([127.0.0.1:7791]) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ECSTREAM id CE/4E-38165-20460AF4 for ; Tue, 01 May 2012 18:30:26 -0400 Authentication-Results: pb1.pair.com header.from=danko@very.lv; sender-id=softfail Authentication-Results: pb1.pair.com smtp.mail=danko@very.lv; spf=softfail; sender-id=softfail Received-SPF: softfail (pb1.pair.com: domain very.lv does not designate 209.85.215.42 as permitted sender) X-PHP-List-Original-Sender: danko@very.lv X-Host-Fingerprint: 209.85.215.42 mail-lpp01m010-f42.google.com Received: from [209.85.215.42] ([209.85.215.42:43471] helo=mail-lpp01m010-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 02/35-38165-2B2EF9F4 for ; Tue, 01 May 2012 09:18:43 -0400 Received: by lahl5 with SMTP id l5so2607510lah.29 for ; Tue, 01 May 2012 06:18:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding :x-gm-message-state; bh=BgXMBVlq5DgOKU00QIeT2QL3Fgb/NEhIa+PY3sdCVbY=; b=axsn4z1XnkHpFagobhzRSoTMnNBJ6sGmWSXncGYs5I/aAP8RlEZCnOreSKx5Dn8YTK 32POEVgP0C8ViCPMJ/eGFs9C9TQE2CkLTJ2n2jsEoLVhEetXtBePnwSPrGfvMDJYMINV C1XmOfnB5eRqX1g4b6behumiqz+TGAgV0TuOV+zwV4Ky1Xad6s/8AejgFcQV/ACrYyyW 8SP9pfV9DQgl0DehrezhYAWaJeBszBcGEeMcWcyTwEVtNBRpvR39kmvyjMxw8aplsalq dN/DTbkZ+37+jecPNM5iqK39bMhOfCHgzvHi0KL2ZOXs+1UfIFZ9cf3VsnrfIkq4WEcS 9r3Q== Received: by 10.152.133.144 with SMTP id pc16mr23567093lab.0.1335878319147; Tue, 01 May 2012 06:18:39 -0700 (PDT) Received: from [192.168.1.104] ([87.246.164.24]) by mx.google.com with ESMTPS id o9sm17908851lbm.14.2012.05.01.06.18.37 (version=SSLv3 cipher=OTHER); Tue, 01 May 2012 06:18:37 -0700 (PDT) Message-ID: <4F9FE2AA.1080509@very.lv> Date: Tue, 01 May 2012 16:18:34 +0300 User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.23) Gecko/20111005 Icedove/3.1.15 MIME-Version: 1.0 To: Laruence CC: reeze , "internals@lists.php.net" , tony2001@php.net, stas@php.net, dmitry@php.net, nikic@php.net, felipe@php.net References: <3B7600EC10A34F89AA8195C7A83089C0@gmail.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQnmcx4WG/uctwBgG7K1mbkALwkGue2ILNOVBTyigqj/Z/+9dER0IeD3wZCH3VKyf+gh1EHa Subject: Re: Bug/Req:#61422顛 enble Type Hint autoloading From: danko@very.lv (Danko Alexeyev) Hi everyone, On 05/01/2012 03:25 PM, Laruence wrote: > if you pass a right instance of class to a function , how can that > class not be loaded already? > > for example: > function foo(Foo_Bar $a) { > } > > how can you pass a Foo_Bar instance to function foo without > Foo_Bar class already defined? > Because Foo_Bar could be *defined* under a different name, say, Foo_Blah. Then, as soon as someone needed Foo_Bar, we would use class_alias to add an alias. That is, as soon as someone tried using Foo_Bar it would turn out that Foo_Bar and Foo_Blah are the same class and all Foo_Blah objects are *also* Foo_Bar objects and everything is cool. Therefore foo(new Foo_Blah()) would work (if there was autoload). Please see the demo I provided at https://bugs.php.net/bug.php?id=61422 Then again, at least it's consistent with instanceof. Where calling autoload by default is probably indeed unacceptable. This is complicated. -- Best regards, Danko Alexeyev, VeryPositive +371 2648 3953 danko@very.lv Skype: d.alexeyev