Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fredemmott-pro:~ fredemmott$ cat test.php
- <?php
- $a = [123, 456];
- foreach ($a as &$item);
- $b = array_combine($a, $a);
- var_dump($a);
- var_dump($b);
- fredemmott-pro:~ fredemmott$ php test.php
- array(2) {
- [0]=>
- int(123)
- [1]=>
- &int(456)
- }
- array(2) {
- [123]=>
- int(123)
- [456]=>
- &int(456)
- }
- fredemmott-pro:~ fredemmott$ hhvm test.php
- Warning: Invalid operand type was used: Invalid type used as key in /Users/fredemmott/test.php on line 5
- Warning: Invalid operand type was used: Invalid type used as key in /Users/fredemmott/test.php on line 5
- array(2) {
- [0]=>
- int(123)
- [1]=>
- &int(456)
- }
- array(0) {
- }
Add Comment
Please, Sign In to add comment