SplFixedArray_key_param.phpt 633 B

123456789101112131415161718192021222324
  1. --TEST--
  2. SplFixedArray::key() with a parameter passed. This is a bug and an error should be called.
  3. --CREDITS--
  4. PHPNW Test Fest 2009 - Jordan Hatch
  5. --FILE--
  6. <?php
  7. $array = new SplFixedArray( 3 );
  8. $array[0] = "Hello";
  9. $array[1] = "world";
  10. $array[2] = "elePHPant";
  11. foreach ( $array as $value ) {
  12. echo $array->key( array("this","should","not","execute") );
  13. }
  14. ?>
  15. --EXPECTF--
  16. Warning: SplFixedArray::key() expects exactly 0 parameters, 1 given in %s on line %d
  17. Warning: SplFixedArray::key() expects exactly 0 parameters, 1 given in %s on line %d
  18. Warning: SplFixedArray::key() expects exactly 0 parameters, 1 given in %s on line %d