declare(strict_types=1); ã¨ã¯ãPHP7ããå°å
¥ããããå³æ ¼ãªåæ¤æ»ã¢ã¼ãã®æå®æ§æã§ãã æå¹ç¯å²ããã¾ãææ¡ãã¦ãªãã£ãã®ã§ã¾ã¨ãã¦ã¿ã¾ããã strict_typesåºæ¬ã®åã ä¾ãã°ãããªã³ã¼ãã <?php function add(int $a, int $b): int { return $a + $b; } var_dump(add(1.0, 2.0)); ãã®ç¶æ
ã§åä½å®è¡ããã¨ãint(3)ãåºåããã¾ãã 渡ãã¦ããã®ã¯doubleåãªã®ã§ããããããªã«ãã£ã¹ãããã¦å¦çããã¦ãã¾ããã¾ããæãªããã®PHPãããåãã§ãã ããã§ãdeclare(strict_types=1)ãæå¹ã«ãã¦ã¿ã¾ãã
{{#tags}}- {{label}}
{{/tags}}