1--TEST-- 2assert() - basic - check switch on warnings using assert_options. 3--INI-- 4assert.active = 1 5assert.warning = 0 6assert.callback = f1 7assert.bail = 0 8assert.quiet_eval = 0 9--FILE-- 10<?php 11function f1() 12{ 13 echo "f1 called\n"; 14} 15 16//switch warning on and test return value 17var_dump($rao=assert_options(ASSERT_WARNING, 1)); 18$sa = "0 != 0"; 19var_dump($r2=assert($sa)); 20$sa = "0 == 0"; 21var_dump($r2=assert($sa)); 22 23//switch warning on and test return value 24var_dump($rao=assert_options(ASSERT_WARNING, 0)); 25--EXPECTF-- 26int(0) 27 28Deprecated: assert(): Calling assert() with a string argument is deprecated in %s on line %d 29f1 called 30 31Warning: assert(): assert($sa): "0 != 0" failed in %s on line 10 32bool(false) 33 34Deprecated: assert(): Calling assert() with a string argument is deprecated in %s on line %d 35bool(true) 36int(1) 37