Created
May 15, 2019 15:02
-
-
Save stevenwadejr/004c785b6680b043ac9df3634d7554b0 to your computer and use it in GitHub Desktop.
WTF PHP Array Initialization
This file contains hidden or 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 | |
$arr_1 = ['foo']; | |
$arr_2[] = 'foo'; | |
var_dump( | |
$arr_1, | |
$arr_2 | |
); | |
// array(1) { | |
// [0]=> | |
// string(3) "foo" | |
// } | |
// array(1) { | |
// [0]=> | |
// string(3) "foo" | |
// } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment