方法/函数重载 [英] Method/function overloading

查看:90
本文介绍了方法/函数重载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我认为在任何版本的PHP中都没有任何方法/函数重载任何

类吗?


谢谢,


Matthew

Am I correct in thinking there is no method/function overloading of any
kind in any version of PHP?

Thanks,

Matthew

推荐答案

12月10日14:17,Matthew< matt ... @ spamkiller.comwrote:
On 10 Dec, 14:17, Matthew <matt...@spamkiller.comwrote:

我是否认为在任何版本的PHP中没有任何方法/函数重载任何

类?


谢谢,


马修
Am I correct in thinking there is no method/function overloading of any
kind in any version of PHP?

Thanks,

Matthew



如果发现任何约758,000件物品,则取决于单词


重载php


进入谷歌符合法案。

Depends if any of the about 758,000 items found by putting the words

overloading php

into Google fit the bill.


Caply Paralytic通过电子邮件发送:
Captain Paralytic emailed this:

12月10日14:17,Matthew< matt ... @ spamkiller.comwrote:
On 10 Dec, 14:17, Matthew <matt...@spamkiller.comwrote:

>我认为在任何版本的PHP中没有任何方法/函数重载任何
类型是正确的?

谢谢,

Matthew
>Am I correct in thinking there is no method/function overloading of any
kind in any version of PHP?

Thanks,

Matthew



如果找到任何约758,000个项目,则取决于< br $>
重载php


进入谷歌符合要求。


Depends if any of the about 758,000 items found by putting the words

overloading php

into Google fit the bill.



我在发布之前就已经这样做了,并获得了课程,属性,方法和

的超载重载扩展。当我查看手册时,我发现了一个名为overload()的函数

,它将在PHP中启用方法和属性重载

版本4> = 4.2.0。


我似乎无法找到我的问题的简单答案,因此我的帖子,

特定于方法/函数(包括构造函数)。我无法找到一个我称之为''方法重载'的例子,你会在C ++,Java,C#等中使用



EG。


函数DoThis()

{

//某事

}

函数DoThis(

I did that before posting, and got hits for class, property, method, and
an extension for overloading. When I looked in manual I found a function
called overload() which will enable method and property overloading in PHP
versions 4 >= 4.2.0.

I can''t seem to find a simple answer to my question, hence my post, which
is specific to methods/functions (including constructors). I was unable to
find an example of what I would call ''method overloading'' that you would
use in C++, Java, C#, etc..

EG.

function DoThis()
{
//something
}
function DoThis(


var1)

{

//一些东西

}

函数DoThis(
var1)
{
//something
}
function DoThis(


这篇关于方法/函数重载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆