Bakti9rov
!*|=?
Бэкслеш - теперь разделитель для неймспейсов
Вот майнтайнеры РНр отожгли... Теперь вместо :: разделителем для неймспейсов в php5.3 становится... бэкслэш! Знак "\"
Как вам такое :
А выбор в пользу этого варианта определился по следующим критерям :
Criterions
(1) type-ability (how easy is it to type the separator)
(2) typo-vulnerability (how easy is it to make a typo and get an unwanted behavior without a error/warning)
(3) parse-ability (how easy is it to read the code and figure out whats going on without getting confused with similar syntax that means another thing)
(4) IDE compatibility
(5) number of chars
http://wiki.php.net/_media/rfc/php.ns.txt?id=rfc:namespaceseparator&cache=cache - здесь history из самого IRC-чата, в ходе которого обсуждались варианты и сложности с "::".
http://wiki.php.net/rfc/namespaceseparator- RFC на эту тему
Вот майнтайнеры РНр отожгли... Теперь вместо :: разделителем для неймспейсов в php5.3 становится... бэкслэш! Знак "\"
Как вам такое :
Код:
$var = new \Foo\Bar\Baz();
Foo\Bar::static_method();
$class_name = "Foo\\Bar";
Criterions
(1) type-ability (how easy is it to type the separator)
(2) typo-vulnerability (how easy is it to make a typo and get an unwanted behavior without a error/warning)
(3) parse-ability (how easy is it to read the code and figure out whats going on without getting confused with similar syntax that means another thing)
(4) IDE compatibility
(5) number of chars
http://wiki.php.net/_media/rfc/php.ns.txt?id=rfc:namespaceseparator&cache=cache - здесь history из самого IRC-чата, в ходе которого обсуждались варианты и сложности с "::".
http://wiki.php.net/rfc/namespaceseparator- RFC на эту тему