Hi lover,
(sorry, couldn't resist)
The correct syntax is:
<?php
// initialize class
$a = new Framework\Utils\Foo();
// namespaced function
Framework\Utils\parse($string);
// static method
Project\PEAR\XML::makeEntity('\\');
// namespaced constant
if ($a == Framework\Utils\FOO) echo "hi";
// class constant
if ($a == Project\PEAR\XML::ZOMG) echo "bye";
?>
Note that static class elements are accessed using T_DOUBLE_COLON (::),
and that the namespace separator \ is used to join namespace and element
name.
OK... thanks for the clarification. That does actually make perfect sense to
me, I just read :: as a method call in Robert's example rather than as a new
class.
Guess I should sleep before typing 'as I understand it' again :)
- Steph
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php