close

php在物件導向的狀態下,建立一個function需要傳入3個函式會出現Warning: Missing argument 3這個錯誤

 像這樣使用就會發生錯誤了

class x{

function checkAdminLogin($workid,$pwd,$apath){

return "x";

}

}

 

但如果將function的部份改為第三個值有預設值就會正常運作了

class x{

function checkAdminLogin($workid,$pwd,$apath=null){

return "x";

}

}

arrow
arrow
    文章標籤
    php Missing argument 3 Warning
    全站熱搜

    mming 發表在 痞客邦 留言(0) 人氣()