PHP中的嵌套类? [英] Nested classes in PHP?
问题描述
大家好,
我记得在PHP5中可以看到嵌套类和命名空间都是可用的。我知道命名空间被取消了(很多悲伤......),然而,我想*嵌套类仍然是一个选项。
但是,我正在寻找有关如何执行此操作的信息,并且
我能够在PHP中找到嵌套类的最新参考是
日期为2003年。他们都说同样的话:抱歉,不能这样做。
所以,这是不可能的?这是问题的结束吗?
试图在PHP5中实现名称空间的任何建议?某种类型
的黑客或变通办法?
感谢您的任何想法。
-jb
Hi All,
I remember reading that both nested classes and namespaces would be
available in PHP5. I know that namespaces got canceled (much sadness...),
however, I *thought* that nested classes were still an option.
However, I am coming up dry looking for information on how to do this, and
the most recent references I am able to find to nested classes in PHP are
dated 2003. And they all say the same thing: sorry, can''t do that.
So, it''s not possible? Is that the end of the matter?
Any suggestions for attempting to implement namespaces in PHP5? Some sort
of hack or workaround?
Thanks for any thoughts.
-jb
推荐答案
2005年1月20日星期四22:21:16 GMT,Joshua Beall
< jb **** @ donotspam.remove.me.heraldic.us>写道:
On Thu, 20 Jan 2005 22:21:16 GMT, "Joshua Beall"
<jb****@donotspam.remove.me.heraldic.us> wrote:
我记得在PHP5中可以看到嵌套类和命名空间都可用。我知道命名空间被取消了(很多悲伤......),然而,我认为*嵌套类仍然是一个选项。
I remember reading that both nested classes and namespaces would be
available in PHP5. I know that namespaces got canceled (much sadness...),
however, I *thought* that nested classes were still an option.
不,他们也得到了印章。
http://cvs.php.net/co.php/ZendEngine2/ChangeLog?r=1.622
搜索嵌套类在那个页面上 - 有一个zend.c的条目说明
嵌套类已经不见了。
-
Andy Hassall /< an ** @ andyh.co.uk> /< http://www.andyh.co.uk>
< http://www.andyhsoftware.co.uk/space>空间:磁盘使用情况分析工具
No, they got the chop too.
http://cvs.php.net/co.php/ZendEngine2/ChangeLog?r=1.622
Search for "nested class" on that page - there''s an entry for zend.c stating
"Nested classes are gone."
--
Andy Hassall / <an**@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
" Joshua Beall" < JB **** @ donotspam.remove.me.heraldic.us>在消息中写道
news:w9WHd.2425
"Joshua Beall" <jb****@donotspam.remove.me.heraldic.us> wrote in message
news:w9WHd.2425
Hg6.2404@trnddc09 ...
Hg6.2404@trnddc09...
大家好,
我记得在PHP5中可以看到嵌套类和名称空间都可用。我知道命名空间被取消了(很多悲伤......),然而,我认为*嵌套类仍然是一种选择。
然而,我正在寻找信息关于如何做到这一点,以及我能够在PHP中找到嵌套类的最新参考资料是2003年的日期。他们都说同样的事情:抱歉,不能这样做。
那么,这是不可能的?这是问题的结束吗?
试图在PHP5中实现名称空间的任何建议?某种黑客或解决方法?
感谢您的任何想法。
-jb
Hi All,
I remember reading that both nested classes and namespaces would be
available in PHP5. I know that namespaces got canceled (much sadness...),
however, I *thought* that nested classes were still an option.
However, I am coming up dry looking for information on how to do this, and
the most recent references I am able to find to nested classes in PHP are
dated 2003. And they all say the same thing: sorry, can''t do that.
So, it''s not possible? Is that the end of the matter?
Any suggestions for attempting to implement namespaces in PHP5? Some sort
of hack or workaround?
Thanks for any thoughts.
-jb
解决方法是使用下划线。
The workaround is to use an underscore.
这篇关于PHP中的嵌套类?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!