Created
March 4, 2012 14:49
-
-
Save hirak/1973356 to your computer and use it in GitHub Desktop.
PHPの変数初期化の癖 ref: http://qiita.com/items/2994
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$a['foo'] = 'hogehoge'; | |
var_export($a); | |
//array( | |
// 'foo' => 'hogehoge' | |
//) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$a[1][2][3] = 'hogehoge'; | |
var_export($a); | |
/* | |
array( | |
1 => array( | |
2 => array( | |
3 => 'hogehoge' | |
) | |
) | |
) | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$a->hoge = 'fuga'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$a; | |
$a['foo'] = 'hogehoge'; | |
$b=null; | |
$b['foo'] = 'hogehoge'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
isset($a->b->c->d[123][321]); | |
empty($a->b->c->d[123][321]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment