3
2

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.

php7.4からimplode関数の引数順序の推奨について

Posted at

implode()は配列の要素を文字列により連結する関数ですが、
explode()とは違ってimplode()は引数のarrayと連結文字のstringの指定順が逆でも動作していました。

それがphp7.4から非推奨になります。
php7.4でE_DEPRECATEDとなり、php8で削除される予定です。
なので現状そのようなコードがあったら、あまり使わない方が好ましいでしょう。

implode()は、歴史的な理由により、引数をどちら の順番でも受けつけることが可能です。

いっつもこの歴史的な理由というのが気になって、どっちだったかごっちゃになるんですよねー。。

3
2
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
3
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?