[PHP-BUG] Bug #75950 [NEW]: when zend.assertions=-1, and assert(sleep(5)); assertions is NOT zero-cost.

[email protected] ("xmlscript at gmail dot com") Sun, 11 Feb 2018 08:37:46 GMT
Newsgroups php.standards
Message-ID <[email protected]>
From:             xmlscript at gmail dot com
Operating system: Fedora 27
PHP version:      7.2.2
Package:          PHP Language Specification
Bug Type:         Bug
Bug description:when zend.assertions=-1, and assert(sleep(5)); assertions is NOT zero-cost.

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 bug report at https://bugs.php.net/bug.php?id=75950&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=75950&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=75950&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=75950&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=75950&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=75950&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=75950&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=75950&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=75950&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=75950&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=75950&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=75950&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=75950&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=75950&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=75950&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=75950&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=75950&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=75950&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=75950&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=75950&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=75950&r=mysqlcfg