summaryrefslogtreecommitdiff
path: root/ext/spl/tests/SplFixedArray_key_setsize.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/spl/tests/SplFixedArray_key_setsize.phpt')
-rw-r--r--ext/spl/tests/SplFixedArray_key_setsize.phpt20
1 files changed, 20 insertions, 0 deletions
diff --git a/ext/spl/tests/SplFixedArray_key_setsize.phpt b/ext/spl/tests/SplFixedArray_key_setsize.phpt
new file mode 100644
index 0000000..97e4811
--- /dev/null
+++ b/ext/spl/tests/SplFixedArray_key_setsize.phpt
@@ -0,0 +1,20 @@
+--TEST--
+SplFixedArray::key() when the array has a size higher than the amount of values specified.
+--CREDITS--
+PHPNW Test Fest 2009 - Jordan Hatch
+--FILE--
+<?php
+
+$array = new SplFixedArray( 4 );
+
+$array[0] = "Hello";
+$array[1] = "world";
+$array[2] = "elePHPant";
+
+foreach ( $array as $value ) {
+ echo $array->key( );
+}
+
+?>
+--EXPECT--
+0123 \ No newline at end of file