assert_basic6.phpt 585 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. --TEST--
  2. assert() - Remove the assert callback
  3. --INI--
  4. assert.active=1
  5. --FILE--
  6. <?php
  7. function f1()
  8. {
  9. echo "foo\n";
  10. }
  11. assert_options(ASSERT_CALLBACK, "f1");
  12. var_dump(assert_options(ASSERT_CALLBACK));
  13. try {
  14. assert(false);
  15. } catch (AssertionError $exception) {
  16. echo $exception->getMessage() . "\n";
  17. }
  18. echo "\n";
  19. assert_options(ASSERT_CALLBACK, null);
  20. var_dump(assert_options(ASSERT_CALLBACK));
  21. try {
  22. assert(false);
  23. } catch (AssertionError $exception) {
  24. echo $exception->getMessage() . "\n";
  25. }
  26. ?>
  27. --EXPECT--
  28. string(2) "f1"
  29. foo
  30. assert(false)
  31. NULL
  32. assert(false)