|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2017-10-27 09:57 UTC] nikic@php.net
-Status: Open
+Status: Not a bug
[2017-10-27 09:57 UTC] nikic@php.net
[2017-12-20 13:17 UTC] mikko dot rantalainen at peda dot net
[2017-12-20 14:10 UTC] nikic@php.net
[2017-12-20 15:05 UTC] kelunik@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 02 22:00:01 2025 UTC |
Description: ------------ Execute the test script: - php -d zend.assertions=1 test.php - php -d zend.assertions=0 test.php - php -d zend.assertions=-1 test.php `assert()` doesn't respect the namespace fallback, but assumes unqualified calls are equivalent to `\assert()` and optimize it away / jump around it with assertions disabled. This is unfortunate, as few people use `\assert()` over `assert()` and wouldn't gain zero-cost assertions without this behavior. Test script: --------------- <?php namespace Test { function assert() { global $foo; $foo = true; } } namespace Test { assert(); var_dump(isset($foo)); } Expected result: ---------------- bool(true) Actual result: -------------- bool(false)