Bug #75769 [Opn]: ASSERT_QUIET_EVAL has no effect
| From: | nikic@php.net | Date: | Fri, 25 Jan 2019 16:09:36 +0000 |
| Subject: | Bug #75769 [Opn]: ASSERT_QUIET_EVAL has no effect | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-219207@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=75769&edit=1
ID: 75769
Updated by: nikic@php.net
Reported by: daniel dot jaenecke at gmail dot com
Summary: ASSERT_QUIET_EVAL has no effect
Status: Open
Type: Bug
Package: PHP options/info functions
Operating System: Linux / not relevant
PHP Version: 7.2.1
Block user comment: N
Private report: N
New Comment:
@cmb: As we don't really have a concept of deprecation for constants (though maybe we should
add one...) we should probably just drop these when we drop support for string asserts in PHP 8, as
they will no longer do anything.
Previous Comments:
------------------------------------------------------------------------
[2018-01-06 13:31:08] cmb@php.net
ASSERT_QUIET_EVAL only works if assert() is called on a string;
cf. <https://3v4l.org/k2rbK>. It seems to me that the
documentation has to be improved, and also that ASSERT_QUIET_EVAL
(and maybe other assert_options) should have been deprecated in
PHP 7.2 (where calling assert() with a string argument) has been
deprecated).
------------------------------------------------------------------------
[2018-01-05 20:45:16] daniel dot jaenecke at gmail dot com
Description:
------------
As far as I understand from the documentation setting ASSERT_QUIET_EVAL / assert.quiet_eval to 1
should suppress any error message triggered when evaluating an assertion.
Either this is not the case or I misunderstand the (rather scarce) documentation on this option.
Test script:
---------------
<?php
error_reporting(E_ALL);
assert_options(ASSERT_QUIET_EVAL, 1);
assert($foo);
Expected result:
----------------
Warning: assert(): assert($foo) failed in [â¦] on line 5
Actual result:
--------------
Notice: Undefined variable: foo in [â¦] on line 5
Warning: assert(): assert($foo) failed in [â¦] on line 5
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=75769&edit=1