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

From: Date: Wed, 14 Feb 2018 06:57:20 +0000
Subject: Bug #75950 [Com]: when zend.assertions=-1, and assert(sleep(5)); assertions is NOT zero-cost.
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-213944@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
 Comment by:         pslacerda+php 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:            Scripting Engine problem
 Operating System:   Fedora 27
 PHP Version:        7.2.2
 Block user comment: N
 Private report:     N

 New Comment:

I couldn't reproduce this error.


Previous Comments:
------------------------------------------------------------------------
[2018-02-11 08:43:32] xmlscript at gmail dot com

<?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.  :(
?>

------------------------------------------------------------------------
[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


Thread (1 message)

  • pslacerda+php at gmail dot com
  • Unknown Message
    • pslacerda+php at gmail dot com
« previous php.bugs (#213944) next »