|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2018-01-02 14:57 UTC] requinix@php.net
-Status: Open
+Status: Not a bug
-Package: *General Issues
+Package: Scripting Engine problem
[2018-01-02 14:57 UTC] requinix@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 15:00:02 2025 UTC |
Description: ------------ PHP Options/Info Namespace coordination assertion cannot use the callback function Test script: --------------- namespace GD\Tool; class Config { public static function init($callback = null) { assert_options(ASSERT_ACTIVE, 1); assert_options(ASSERT_WARNING, 0); assert_options(ASSERT_BAIL, 1); if($callback !== null){ assert_options(ASSERT_CALLBACK, $callback); } } public static function assert($assertion,$info = ''){ if((int)PHP_VERSION >= 7 ){ is_object($info) ? : die('not an object'); }else{ is_string($info) ? : die('not an string'); } return assert($assertion,$info); } } Config::init('test'); function test($file, $line, $code){ die("file:{$file} \n line:{$line} \n code{$code}"); } Config::assert('1==2'); echo 'success';