長期運用コンテンツで放置されつづけていた警告を修正した際のメモです
Warning
引数があってない
Missing argument
関数の引数の数が違う
sprintf(): Too few arguments
変換指定子と引数の数が違う
型が違う
str_pad() expects parameter 1 to be string, object given
string型にint型を渡している
implode(): Invalid arguments passed
配列じゃないものを渡している
Illegal string offset
配列ではなく文字列を渡している
mt_rand
mt_rand(): max(0) is smaller than min(1)
最小値が最大値を上回っている
notice
定数の宣言
Use of undefined constant
定数を""で宣言している → ''に修正
存在しない
Undefined [offset,index,variable,property]
Trying to get property of non-object in
存在しないものを指定している
配列
Array to string conversion
array_diffに多次元配列を渡していた → foreachで展開して一次元配列同士で比較
Strict Standards
Non-static method
staticにnattenai
Only variables should be passed by reference in
参照渡しを要求するメソッドに値を直接渡して呼び出している
Declaration of XXX
オーバライドしたメソッドの引数の数などが親クラスと異なっている