PHP ã® RFC ã¨ãã¦ææ¡ããã "var" deprecation ã«ã¤ãã¦ã第 102 回 PHP 勉強会 ã®æè¦ªä¼ LT ã§çºè¡¨ãã¾ãããçºè¡¨è³æãå
¬éãã¾ã*1ã
"var" ã¨ãããã¼ã¯ã¼ãã¯ãPHP 4 ã§ã¯ã©ã¹ã®ããããã£å®ç¾©ã«ç¨ãããããã¼ã¯ã¼ãã§ã*2ãå½æã® PHP ã¯ããªãã¸ã§ã¯ãæåãå°å ¥ããããã®ã® private ã static ã¨ãã£ãæ©è½ã¯åå¨ãã¦ãã¾ããã§ãããã¯ã©ã¹ã®ããããã£ã¯ var ãç¨ãã¦æ¬¡ã®ããã«å®ç¾©ãã¦ããããã§ãã
class Hoge { var $fuga; }
PHP 5 ãã private ã static çã®æ©è½ãå°å ¥ãããç¾å¨ã® PHP ã®ãããªæ¸ãæ¹ãã§ããããã«ãªãã¾ããããå¾æ¹äºææ§ãç¶æããããã« var ã¨ãããã¼ã¯ã¼ãã¯å»æ¢ããã¦ãã¾ãããä¸è¨ã®ã³ã¼ãã¯ãä»ã® PHP ã§ãæ£ããããã°ã©ã ã¨ãã¦åä½ãã¾ã*3ã
ãã¦ãä»ååãä¸ãã "var" deprecation ã¨ãã RFC ã¯ããããã var ã«ããããããã£å®ç¾©ã®æ§æãå»æ¢ãã¦ã¯ã©ããã¨ããææ¡ã§ããPHP 7.1 ã§ãå»æ¢äºå®ãã¨ãã¦ç§»è¡ãä¿ãããã¤ã PHP 8.0 ããªãªã¼ã¹ãããã¨ãã«æ§æããåé¤ãããã¨ãããã¼ãããããææ¡ããã¾ãããçºè¡¨è³æã¯ããã®ææ¡ã«å¯¾ããè°è«ãæ票çµæãã¾ã¨ãã¦ç´¹ä»ããã¨ãããã®ã§ãã
RFC ã«å¯¾ããè°è«ã¯ PHP ã® internal ML ã§ç¢ºèªã§ãã¾ããã¢ã¼ã«ã¤ããå
¬éããã¦ãããã¡ã¼ãªã³ã°ãªã¹ããè³¼èªãã¦ããªãã¦ãè°è«ã追ããããã«ãªã£ã¦ãã¾ã*4ãæã
ã§ãçºãã¦ã¿ãã¨ãé¢ç½ãããããã¾ããã
MARC: Mailing list ARChives
ã¾ããå½å
ã§ã¯ Slack ã« phpusers-ja ã¨ããã°ã«ã¼ããä½ããã¦ãã¾ããç§ãç»é²ãã¦ããã®ã§ãããPHP ã¦ã¼ã¶ã®æ¹ã
ãæ¥ã
æ°é®®ãªæ
å ±ãæä¾ãã¦ãããã®ã§ãã¨ã¦ãéå®ãã¦ãã¾ããè±èªåã®æ
å ±ã«å¯¾ãã¦ä¸äººã§ã¢ã³ãããå¼µãå·¡ãããã®ã¯ãªããªã大å¤ã ã¨æãã¾ãã®ã§ããããã£ãã³ãã¥ããã£ãæ´»ç¨ãã¦æ
å ±ãå
±æã§ããã¨ããã®ã§ã¯ãªãã§ããããã
Join PHP ユーザーズ (日本語) on Slack!
*1:ã¹ã©ã¤ãã®ã¿ã¤ãã«ã«è¨è¼ãã twitter ã¢ã«ã¦ã³ããééã£ã¦ãã¾ãã@y__uti ãæ£ããã§ãã
*2:ç§ã¯ãã®é 㯠PHP ã使ã£ã¦ããªãã£ãã®ã§ãå®éã« var ã¨ãããã¼ã¯ã¼ãã使ã£ã¦ããã°ã©ã ãæ¸ãããã¨ã¯ãªãã®ã§ããã
*3:var ã§å®ç¾©ãããããããã£ã¯ãpublic ã§é static ãªããããã£ã¨è§£éããã¾ãã
*4:ãã®è¨äºãæ¸ãã¦ãã 5/27 æç¹ã§ã¯ãtyped properties ã«é¢ãã¦ç¹ã«æ´»çºãªè°è«ãè¡ããã¦ããããã§ãã