Doc #75711 [NEW]: php.ini documentation fails to mention zend.assertions
From: mikko dot rantalainen at peda dot net
Operating system: Ubuntu Linux 16.04 LTS
PHP version: 7.0.26
Package: Documentation problem
Bug Type: Documentation Problem
Bug description:php.ini documentation fails to mention zend.assertions
Description:
------------
---
From manual page: http://www.php.net/info.configuration
---
...
assert.active boolean
Enable assert() evaluation.
...
This is no longer true. PHP 7 requires setting zend.assertions=1 in
php.ini or assert() will never do nothing.
The above referenced runtime configuration should include following from
http://php.net/assert:
PHP 7 configuration directives for assert()
Directive Default value Possible values
zend.assertions (default 1)
1: generate and execute code (development mode)
0: generate code but jump around it at runtime
-1: do not generate code (production mode)
assert.exception (default 0)
1: throw when the assertion fails, either by throwing the object
provided as the exception or by throwing a new AssertionError object if
exception wasn't provided
0: use or generate a Throwable as described above, but only generate a
warning based on that object rather than throwing it (compatible with
PHP 5 behaviour)
Test script:
---------------
<?php ini_set("assert.active", 1); assert(false); ?>
or directly from command line:
php -d zend.assertions=-1 -r 'ini_set("assert.active", 1);
assert(false);'
vs
php -d zend.assertions=1 -r 'ini_set("assert.active", 1);
assert(false);'
Expected result:
----------------
Above test script should display a warning or uncatched exception about
failed assert. Instead, with default PHP 7 configuration, nothing will
happen.
--
Edit bug report at https://bugs.php.net/bug.php?id=75711&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=75711&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=75711&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=75711&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=75711&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=75711&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=75711&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=75711&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=75711&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=75711&r=support
Expected behavior: https://bugs.php.net/fix.php?id=75711&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=75711&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=75711&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=75711&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=75711&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=75711&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=75711&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=75711&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=75711&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=75711&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=75711&r=mysqlcfg
Thread (2 messages)
- mikko dot rantalainen at peda dot net