/hphp/test/zend/good/ext/standard/tests/assert/assert.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
- <?php
- function a($file,$line,$myev)
- {
- echo "assertion failed $line,\"$myev\"\n";
- }
- class a
- {
- function assert($file,$line,$myev)
- {
- echo "class assertion failed $line,\"$myev\"\n";
- }
- }
- assert_options(ASSERT_ACTIVE,1);
- assert_options(ASSERT_QUIET_EVAL,1);
- assert_options(ASSERT_WARNING,0);
- $a = 0;
- assert_options(ASSERT_CALLBACK,"a");
- assert('$a != 0');
- assert_options(ASSERT_CALLBACK,array("a","assert"));
- assert('$a != 0');
- $obj = new a();
- assert_options(ASSERT_CALLBACK,array(&$obj,"assert"));
- assert('$a != 0');
- ?>