Re: cvs: ZendEngine2(PHP_5_3) / zend.h zend_compile.c zend_compile.h zend_constants.c zend_execute_API.c zend_language_parser.y zend_vm_def.h
zend_vm_execute.h /tests bug42802.phpt bug42819.phpt bug43332_1.phpt class_alias_021.phpt ns_002.phpt ns_004.phpt ns

From: Date: Wed, 12 Nov 2008 20:45:32 +0000
Subject: Re: cvs: ZendEngine2(PHP_5_3) / zend.h zend_compile.c zend_compile.h zend_constants.c zend_execute_API.c zend_language_parser.y zend_vm_def.h
zend_vm_execute.h /tests bug42802.phpt bug42819.phpt bug43332_1.phpt class_alias_021.phpt ns_002.phpt ns_004.phpt ns
References: 1 2  Groups: php.doc 
Request: Send a blank email to phpdoc+get-969379677@lists.php.net to get a copy of this message
Hi!
1) commit of namespace brackets support 2) review by Stas for any problems Once these two things are done, I'll commit. For those interested, I have a draft up at http://pear.php.net/~greg/nsdocs/language.namespaces.html
In general, good work, thanks! My notes: 1. namespace\ is not operator. It's a keyword, which can be used instead of current namespace name. 2. Sub-namespace is an unfortunate name - there's nothing "sub" in MyProject\Sub\Level, maybe better to call it "multi-component names" etc. In general, single- and mutli-component names work exactly the same, so I'm not sure they should have separate chapters - just show in one chapter that name can be foo or foo\bar\baz and that's it. 3. In "Using namespaces: Basics" the fallback should be mentioned immediately, otherwise readers that don't read whole page would not know it exists. 4. Many examples have \\ inside single quotes - this should be fixed. In single quotes, single slash is enough. 5. I don't like "echos" when describing output - maybe better "outputs"? 6. Import chapter should mention special case of: use \GlobalClass; which can be used to use GlobalClass without qualifying (unlike use GlobalClass which is just a NOP). Also, it'd be nice to explicitly say that even though you can use both My\Full\Classname and \My\Full\Classname, they are the same in this context since imports do not need qualification. 7. In rules, imports influence all class names, both qualified and unqualified. They do not influence fully qualified ones, though - like \foo\bar. 8. namespace\Foo is a fully qualified name too. 9. "Inside namespace, calls to unqualified functions that are defined in the current namespace and are in the same file are interpreted as calls to these namespace functions, at compile time." - IIRC this is not true currently. 10. items 7 and 8 say basically the same. And autoloading is part of looking for the class, so it's not two-step process, actually - it's one-step process which applies to all class names, and the class name is always resolved compile-time, no matter what. 11. Undefined constants that are not qualified can be substituted as string (echo FOO outputs FOO), but any qualification would lead to undefined constant produce an error. 12. I would not call not nesting namespaces "pitfall" - it has a meaning of unexpected negative effect, but we actually did it intentionally. Maybe "limitations" or "restrictions"? 13. "Dynamic namespace names (quoted identifiers) should escape backslash" should be "Use single quotes!" 14. Somewhere we should mention you cannot override special constants like NULL, true, false, etc. -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com

« previous php.doc (#969379677) next »