assert_basic3.phpt 445 B

12345678910111213141516171819202122232425
  1. --TEST--
  2. assert() - basic - Test that bailout works
  3. --INI--
  4. assert.active = 1
  5. assert.warning = 1
  6. assert.callback = f1
  7. assert.bail = 0
  8. assert.exception=0
  9. --FILE--
  10. <?php
  11. function f1()
  12. {
  13. echo "f1 called\n";
  14. }
  15. //bail out on error
  16. var_dump($rao=assert_options(ASSERT_BAIL, 1));
  17. var_dump($r2=assert(0 != 0));
  18. echo "If this is printed BAIL hasn't worked";
  19. ?>
  20. --EXPECTF--
  21. int(0)
  22. f1 called
  23. Warning: assert(): assert(0 != 0) failed in %s on line %d