在PHP中,您可以将类扩展为相同的名称?(In PHP can you extend a class to the same name?)

编程入门 行业动态 更新时间:2024-10-17 23:24:01
在PHP中,您可以将类扩展为相同的名称?(In PHP can you extend a class to the same name?)

我试图找出我可以做或不做的天气。 我有一个叫Template的类。 我想在另一个文件中扩展这个类的功能,但我不想改变它的名字。

我是否将其声明为

class template extends template { // code here function foo() { } }

或者我只是像这样宣布它?

class template { // write function function foo() { } }

I'm trying to find out weather I can do this or not. I have a class called Template. and I want to extend that classes functionality in another file, but I don't want to change the name.

Do I declare it as

class template extends template { // code here function foo() { } }

or do I just declare it like this?

class template { // write function function foo() { } }

最满意答案

你可能想看看classkit

You might want to check out classkit

更多推荐

本文发布于:2023-07-22 09:51:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1219129.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:您可以   名称   PHP   extend   class

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!