I R O Y O S H I Z U M I 株式会社Fusic エンジニア 生まれも育ちも大阪府。中学時代に通ったプログラミングスクー ルがきっかけで情報分野に興味を持ち、情報系の大学に進学。 「面白そうな人たちが面白そうなことしてる」とFusicの個性に惹 かれ2025年4月に新卒入社。 自己紹介 はじめに @zumi_engineer ←福岡でPHPの勉強会を運営しています
設定したstrict_typesを使う strict でも int → float は例外 The one exception is that widening primitive conversion is allowed for int to float. This means that parameters that declare float can also accept int. (RFCより抜粋) 3が3.0になっても数値に関する情報が失われないの で例外的にOK ≒float ≒int
string bool object int yes no no no no float yes yes no no no string no no yes no no bool no no no yes no declare(strict_types=1);がある時 declare(strict_types=1);がない時
strict_types ディレクティブの背後にある考え方は、 2つのバージョンの機能を 1 つのシステムに統合し、ユーザーが自由に切り替えられるようにすることでし た。提案では、両方のモードにそれぞれ長所と短所があることが明確に示され ていました。 Re: strict_types will be default at some moment? 我々はどう使い分けるか https://news-web.php.net/php.internals/112232