Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:17165 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 53099 invoked by uid 1010); 7 Jul 2005 14:40:38 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 53084 invoked from network); 7 Jul 2005 14:40:38 -0000 Received: from unknown (HELO gmail.com) (127.0.0.1) by localhost with SMTP; 7 Jul 2005 14:40:38 -0000 X-Host-Fingerprint: 63.118.113.4 miami4.us.univision.com Received: from ([63.118.113.4:29041] helo=localhost.localdomain) by pb1.pair.com (ecelerity 1.2 r(5656M)) with SMTP id 3A/8A-05285-5EE3DC24 for ; Thu, 07 Jul 2005 10:40:37 -0400 Message-ID: <3A.8A.05285.5EE3DC24@pb1.pair.com> To: internals@lists.php.net References: <84.75.05285.5EA7CC24@pb1.pair.com> <0MKwh2-1DqTBy43Wu-0004sH@mrelayeu.kundenserver.de> Date: Thu, 7 Jul 2005 10:40:40 -0400 Lines: 55 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1506 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506 X-Posted-By: 63.118.113.4 Subject: Re: [PHP-DEV] YANP (Yet Another Namespace Proposal) From: jrhernandez05@gmail.com ("Jessie Hernandez") Actually, this will work! In the "class_name_reference" rule, the "zend_do_fetch_class" function is called. Inside this function, class_name is a znode, and what is assigned to the opcode is "opline->op2 = *class_name". This function is changed to check the import hashtable, and if a match is found, then the znode string value is updated to contain the full class name! Here's some pseudocode: "lang:Object" added to import hashtable $o = new Object(); // zend_do_fetch_class checks for "Object" in the import hashtable. // A match is found, so "class_name->u.constant.value.str" is modified from "Object" to "lang:Object". // At runtime, the lang:Object class will be created and added to class_table, // and since all opcodes are using lang:Object instead of simply Object, then everything will work. ?> -- Jessie ""Timm Friebe"" wrote in message news:0MKwh2-1DqTBy43Wu-0004sH@mrelayeu.kundenserver.de... > [...] > > - All imports are done at compile time. > > So: > > == Object.php == > package lang { class Object { > > }} > ?> > > == script.php == > include('Object.php'); > > import lang:Object; > ?> > > ...will not work. You'll need an opcode for this. > > - Timm