Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:49803 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 58543 invoked from network); 29 Sep 2010 21:29:09 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Sep 2010 21:29:09 -0000 Authentication-Results: pb1.pair.com smtp.mail=quickshiftin@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=quickshiftin@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.161.42 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: quickshiftin@gmail.com X-Host-Fingerprint: 209.85.161.42 mail-fx0-f42.google.com Received: from [209.85.161.42] ([209.85.161.42:34563] helo=mail-fx0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8E/84-37853-4AFA3AC4 for ; Wed, 29 Sep 2010 17:29:09 -0400 Received: by fxm11 with SMTP id 11so1144532fxm.29 for ; Wed, 29 Sep 2010 14:29:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=X3tP5JhPYrvXvWBPFHSiZ/1Xb5kzv+3lkZ4lt2Vz9VQ=; b=rRxgBQR6Zxp4WzSZvQeELdCTzvODERPXpxzA1tqfuUTkSW0Z3hE4T6IVIq6a3hV2Mb /j3cYz2VTj6jDKvj2KRO7KcdnQNDX8GJtcWi68Rl9crUOmqJDSo1AueyH4FWJp4BsGNx q4VO3z/zsQ2IRBLdaAcFKgXFk7pbYVTH1zvfU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=Ze0aXH2PJUtyyPFDKRny7AJW00JPRhDCC1YGbm7TJwTMjpzJwCMTRQCR960ByffnJD csbULnHySVFB/JtPumaRM+5bB7I4t+A+ZT/hne5V8r9wztSFM/lQLtDIRoH89dJlb75r yay/YP/R29BXQ5X9THZkYjoA5SEo8u+mHAbwY= MIME-Version: 1.0 Received: by 10.239.153.209 with SMTP id a17mr239595hbc.68.1285795746168; Wed, 29 Sep 2010 14:29:06 -0700 (PDT) Received: by 10.239.189.72 with HTTP; Wed, 29 Sep 2010 14:29:06 -0700 (PDT) In-Reply-To: <4CA3A7EF.6000201@sugarcrm.com> References: <4CA3A7EF.6000201@sugarcrm.com> Date: Wed, 29 Sep 2010 15:29:06 -0600 Message-ID: To: Stas Malyshev Cc: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=001485f1e968b43e5504916ca61b Subject: Re: [PHP-DEV] Bug in 5.3 __invoke() magic method? From: quickshiftin@gmail.com (Nathan Nobbe) --001485f1e968b43e5504916ca61b Content-Type: text/plain; charset=UTF-8 On Wed, Sep 29, 2010 at 2:56 PM, Stas Malyshev wrote: > Hi! > > > public function __construct() >> { >> $this->a = new A(); >> $this->a(); >> > > Here you are calling method a() of object $this. Such method does not > exist. No bug here. Methods are properties are different things. Stas, thanks for this. Seems that w/ __invoke() in 5.3 if a method property is_callable then the engine should check for that and call it. I realize the problem now though, in php instance variables can have the same identifier as instance methods therefore collisions could exist, for example class B { function __invoke() {} } class A { public $c = null; function c() {} } $a = new A(); $a->c = new B(); $a->c(); seems i got the notion this would work from javascript, however i also realize the reason it works there, only a single identifier is allowed which would map to either a scalar or a function object and in the later case would be invokable. the implementation in php make sense to me now. thanks for your time, -nathan --001485f1e968b43e5504916ca61b--