简体   繁体   English

PHP5.3中的引用函数和普通函数有什么区别?

[英]what is the difference between reference function and normal function in PHP5.3?

hi I am a php developer. 嗨,我是一名PHP开发人员。

Recently I got an old project using php5 which I have to upgrade to PHP5.3. 最近,我有一个使用php5的旧项目,我必须升级到PHP5.3。

In old version of php5 coding they declare functions in two different ways 在旧版本的php5编码中,它们以两种不同的方式声明函数

public function &getMyname(){

}

Some other place they are defining like normal 他们定义的其他一些地方像平常一样

public function getMyname(){

}

What is the difference between these two declarations. 这两个声明之间有什么区别。

The first method will return by reference. 第一种方法将通过引用返回。

http://www.php.net/manual/en/language.references.return.php http://www.php.net/manual/zh/language.references.return.php

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM