0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

PHPの警告修正メモ

Posted at

長期運用コンテンツで放置されつづけていた警告を修正した際のメモです

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

オーバライドしたメソッドの引数の数などが親クラスと異なっている

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?