Created
December 29, 2015 19:03
-
-
Save bobmagicii/605473b7e6c19df28720 to your computer and use it in GitHub Desktop.
constant arrays. huh.
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 | |
/* | |
C:\Users\bob\Desktop>php test.php | |
int(1) | |
string(3) "omg" | |
int(2) | |
string(3) "wtf" | |
int(4) | |
string(3) "bbq" | |
*/ | |
class Whatever { | |
const Things = [ | |
1 => 'omg', | |
2 => 'wtf', | |
4 => 'bbq' | |
]; | |
} | |
foreach(Whatever::Things as $Bit => $String) | |
var_dump($Bit,$String); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment