You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
522 B

  1. --TEST--
  2. Check that SplObjectStorage::attach generates a warning and returns NULL when bad params are passed
  3. --CREDITS--
  4. PHPNW Testfest 2009 - Simon Westcott (swestcott@gmail.com)
  5. --FILE--
  6. <?php
  7. $s = new SplObjectStorage();
  8. var_dump($s->attach(true));
  9. var_dump($s->attach(new stdClass, true, true));
  10. ?>
  11. --EXPECTF--
  12. Warning: SplObjectStorage::attach() expects parameter 1 to be object, boolean given in %s on line %d
  13. NULL
  14. Warning: SplObjectStorage::attach() expects at most 2 parameters, 3 given in %s on line %d
  15. NULL