assert_basic2.phpt 637 B

12345678910111213141516171819202122232425262728293031323334353637
  1. --TEST--
  2. assert() - basic - correct call back values before and after assert.
  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 f2()
  12. {
  13. echo "f2 called\n";
  14. }
  15. function f1()
  16. {
  17. echo "f1 called\n";
  18. }
  19. var_dump($o = assert_options(ASSERT_CALLBACK));
  20. assert(0);
  21. var_dump($o= assert_options(ASSERT_CALLBACK, "f2"));
  22. var_dump($n= assert_options(ASSERT_CALLBACK));
  23. assert(0);
  24. ?>
  25. --EXPECTF--
  26. string(2) "f1"
  27. f1 called
  28. Warning: assert(): assert(0) failed in %s on line 13
  29. string(2) "f1"
  30. string(2) "f2"
  31. f2 called
  32. Warning: assert(): assert(0) failed in %s on line 17