Bug #75950 [Opn]: when zend.assertions=-1, and assert(sleep(5)); assertions is NOT zero-cost.
| From: | xmlscript at gmail dot com | Date: | Sun, 11 Feb 2018 08:43:34 +0000 |
| Subject: | Bug #75950 [Opn]: when zend.assertions=-1, and assert(sleep(5)); assertions is NOT zero-cost. | ||
| References: | 1 | Groups: | php.standards |
| Request: | Send a blank email to standards-+get-1314@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=75950&edit=1
ID: 75950
User updated by: xmlscript at gmail dot com
Reported by: xmlscript at gmail dot com
Summary: when zend.assertions=-1, and assert(sleep(5));
assertions is NOT zero-cost.
Status: Open
Type: Bug
Package: PHP Language Specification
Operating System: Fedora 27
PHP Version: 7.2.2
Block user comment: N
Private report: N
New Comment:
<?php
/**
* php-fpm 7.2.2
* zend.assertions = -1
*/
var_dump( ini_get('zend.assertions') ); // return -1
assert_options(ASSERT_ACTIVE, false);
assert( 'sleep(5)' ); //with string, assertion code will not be generated, and throwed
an "Deprecated: assert(): Calling assert() with a string argument is deprecated in ..."
assert( sleep(5) ); //really waited for 5 seconds, is NOT assertions zero-cost. :(
?>
Previous Comments:
------------------------------------------------------------------------
[2018-02-11 08:37:45] xmlscript at gmail dot com
Description:
------------
<?php
/**
* php-fpm 7.2.2
* zend.assertions = -1
*/
var_dump( ini_get('zend.assertions') ); // return -1
assert_options(ASSERT_ACTIVE, true);
assert( 'sleep(5)' ); //with string, assertion code will not be generated, and throwed
an "Deprecated: assert(): Calling assert() with a string argument is deprecated in ..."
assert( sleep(5) ); //really waited for 5 seconds, is NOT assertions zero-cost. :(
?>
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=75950&edit=1