[請益] return from a function

看板PHP作者 (陸奧鬼一)時間17年前 (2008/09/18 20:48), 編輯推噓0(002)
留言2則, 2人參與, 最新討論串1/1
PHP 官方文件裡提到可以 Returning a reference from a function (出處: http://www.php.net/manual/en/functions.returning-values.php) 官方範例: <?php function &returns_reference() { return $someref; } $newref =& returns_reference(); ?> 我想請問一下,在同一個程式裡,可以再定義另一個這樣的 function 嗎? 差別在少了 function name 前面的「&」。 <?php function returns_reference() { return $someref; } ?> -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 219.84.124.162

09/18 21:08, , 1F
其實直接試一下應該就知道囉 :)
09/18 21:08, 1F

09/19 10:58, , 2F
嗯,試出來了: Fatal error: Cannot redeclare
09/19 10:58, 2F
文章代碼(AID): #18qauE5C (PHP)
文章代碼(AID): #18qauE5C (PHP)