Question : zero-cost assertions(1)
Answered by : disturbed-dugong-aqv81pl3r81n
function test($arg) { assert($arg > 20 && $arg < 110, "$arg is invalid");
}
ini_set('zend.assertions',0); test(16);
ini_set('zend.assertions',1); test(17);
ini_set('assert.exception',1); test(18);
Source : http://talks.php.net/confoo16#/php7assert | Last Update : Tue, 29 Jun 21
Question : zero-cost assertions(2)
Answered by : disturbed-dugong-aqv81pl3r81n
; Completely skip compiling assert() calls
; (can only be set in php.ini)
zend.assertions = -1
Source : http://talks.php.net/confoo16#/php7assert | Last Update : Tue, 29 Jun 21