Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:14274 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 87153 invoked by uid 1010); 4 Jan 2005 11:42:25 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 87133 invoked from network); 4 Jan 2005 11:42:24 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Jan 2005 11:42:24 -0000 X-Host-Fingerprint: 64.233.184.207 wproxy.gmail.com Linux 2.4/2.6 Received: from ([64.233.184.207:55442] helo=wproxy.gmail.com) by pb1.pair.com (ecelerity HEAD (r3992M)) with SMTP id 7D/5A-27561-F118AD14 for ; Tue, 04 Jan 2005 06:42:23 -0500 Received: by wproxy.gmail.com with SMTP id 69so169576wra for ; Tue, 04 Jan 2005 03:42:20 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=lzNpteDVp8D7Bx0nwiDfFnyOHn/2UbJ8R7vvsS8ppHeAVwxWoBYamfAoJG+bqfarmo/eUoDgrowZ9sGnlFOqG1q5iBRsfEXVKzUlon31MPFlqrmDhNYC8CKSfvlBwjdqVvKa0+Jb3VoE2VrgsneK3yCe8gR2ydObZSc+nQvnkqc= Received: by 10.54.13.53 with SMTP id 53mr139899wrm; Tue, 04 Jan 2005 03:42:20 -0800 (PST) Received: by 10.54.32.7 with HTTP; Tue, 4 Jan 2005 03:42:20 -0800 (PST) Message-ID: <5c2874720501040342d92196d@mail.gmail.com> Date: Tue, 4 Jan 2005 05:42:20 -0600 Reply-To: Jason Sweat To: Gareth Ardron Cc: internals@lists.php.net In-Reply-To: <41DA068A.9080009@fission.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <41DA068A.9080009@fission.org.uk> Subject: Re: [PHP-DEV] bit of an odd bug From: jason.sweat@gmail.com (Jason Sweat) On Tue, 04 Jan 2005 02:59:22 +0000, Gareth Ardron wrote: > Ok, I'm in need of a sanity check here. > > step one: > $input = "foo"; > $scanning_class = "clamav"; > $result = $scanning_class::scanBuffer($input); > now this fails with a "Parse error: parse error, unexpected > T_PAAMAYIM_NEKUDOTAYIM" > > So ok, you can't put variables at the front on a class call like that. > Minor bug I'm thinking at this point, but I wonder if I can work round > it. So, onto step two: > $input = "foo"; > $scanning_class = "clamav"; > $func = $scanning_class."::scanBuffer"; > $result = $func($input); > Which fails with a "Fatal error: Call to undefined function > clamav::scanBuffer()" > > Just doing: > $result = clamav::scanBuffer($input); > of course works absolutly fine. > > Somebody just tell me that this isn't exactly expected behaviour and > it's a minor bug > > this is all on 5.0.3 btw. Hi Gareth, In addition to the other options people have mentioned, you could also use the old standby of: eval("\$result = $scanning_class::scanBuffer(\$input);"); Regards, Jason http://blog.casey-sweat.us/