Created
April 2, 2010 14:44
-
-
Save jpic/353199 to your computer and use it in GitHub Desktop.
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 | |
$fixture = new ArrayObject( array( | |
'a', | |
'b', | |
'c', | |
) ); | |
unset( $fixture[1] ); | |
$fixture = new ArrayObject( | |
array_values($fixture) | |
); | |
var_dump( $fixture ); | |
# Warning: array_values(): The argument should be an array in /tmp/test.php on line 12 | |
# | |
# Fatal error: Uncaught exception 'InvalidArgumentException' with message 'Passed variable is not an array or object, using empty array instead' in /tmp/test.php:13 | |
# Stack trace: | |
# #0 /tmp/test.php(13): ArrayObject->__construct(NULL) | |
# #1 {main} | |
# thrown in /tmp/test.php on line 13 | |
# | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment