PageRenderTime 38ms CodeModel.GetById 15ms RepoModel.GetById 1ms app.codeStats 0ms

/hphp/test/zend/good/ext/standard/tests/assert/assert.php

http://github.com/facebook/hiphop-php
PHP | 30 lines | 24 code | 6 blank | 0 comment | 0 complexity | 1633beda30329bd7d847693e40862bd3 MD5 | raw file
Possible License(s): LGPL-2.1, BSD-2-Clause, BSD-3-Clause, MPL-2.0-no-copyleft-exception, MIT, LGPL-2.0, Apache-2.0
  1. <?php
  2. function a($file,$line,$myev)
  3. {
  4. echo "assertion failed $line,\"$myev\"\n";
  5. }
  6. class a
  7. {
  8. function assert($file,$line,$myev)
  9. {
  10. echo "class assertion failed $line,\"$myev\"\n";
  11. }
  12. }
  13. assert_options(ASSERT_ACTIVE,1);
  14. assert_options(ASSERT_QUIET_EVAL,1);
  15. assert_options(ASSERT_WARNING,0);
  16. $a = 0;
  17. assert_options(ASSERT_CALLBACK,"a");
  18. assert('$a != 0');
  19. assert_options(ASSERT_CALLBACK,array("a","assert"));
  20. assert('$a != 0');
  21. $obj = new a();
  22. assert_options(ASSERT_CALLBACK,array(&$obj,"assert"));
  23. assert('$a != 0');
  24. ?>