PHPã®æååã¾ããã調ã¹ãããã®æ¡å¼µã¢ã¸ã¥ã¼ã«ãä½ã£ã¦ã¿ã
ãã®ã¨ã³ããªã¯闇PHP Advent Calendar 2015ã®11æ¥ç®ã§ãã
strdumperã¨ããPHPæ¡å¼µã¢ã¸ã¥ã¼ã«ãä½ãã¾ããã
ç¾æç¹ã§ã¯ããã®æ¡å¼µã¢ã¸ã¥ã¼ã«ã¯ä¸è¨ã®3ã¤ã®é¢æ°ãå®è£
ãã¦ãã¾ãã
str_dump
void str_dump(mixed $var)
$varãæåååã ã£ãå ´åã«ã詳細ã®æ
å ±ãåºåãã¾ãã
is_interned
bool is_interned(mixed $var)
$varãæåååãã¤ã¤ã³ã¿ã¼ã³åæååã ã£ãå ´åã«trueãããã以å¤ã®å ´åã«falseãè¿ãã¾ãã
interned_strings
array interned_strings()
ãã®æç¹ã§ã®å
¨ã¤ã³ã¿ã¼ã³åæååã®é
åãè¿ãã¾ãã
å©ç¨ä¾
ãããå©ç¨ããã¨ãä¾ãã°ä¸è¨ã®ãããªå®é¨ãè¡ããã¨ãã§ãã¾ãã
<?php $a["foo"] = 1; $b = key($a); var_dump(is_interned($b)); /* PHP 5.4&5.5: false / PHP5.6: true */
ãã®ããã«ãPHP5.5ã¾ã§ã¯é
åã®ãã¼ã¯ã¤ã³ã¿ã¼ã³åæååã«ãªããªãã£ãã®ããPHP 5.6ããã¯é
åã®ãã¼ã«ãã¤ã³ã¿ã¼ã³åæååã使ãããããã«ãªã£ããã¨ããããã¾ãã
ä»ã«ãé¢ç½ãå®é¨ãã§ãããã¨æãã®ã§ããã®æ¡å¼µã¢ã¸ã¥ã¼ã«ã使ã£ã¦è²ã å®é¨ãã¦ããããã¨å¬ããã§ãã