|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2016-12-01 17:14 UTC] cmb@php.net
-Status: Open
+Status: Verified
[2016-12-01 17:14 UTC] cmb@php.net
[2018-02-11 18:38 UTC] carusogabriel34 at gmail dot com
[2023-04-11 11:49 UTC] bloginteriorhome at gmail dot com
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 20:00:01 2025 UTC |
Description: ------------ ReflectionParameter::getDefaultValueConstantName() returns wrong value in namespace context, in particular, invocated in a namespace, it returns wrong value for global constants Test script: --------------- <?php namespace { define('SOME_CONSTANT', 1); } namespace Some\Name\Space { use ReflectionFunction; $reflection = new ReflectionFunction(function ($const = PHP_EOL, $const2 = SOME_CONSTANT) { }); echo $reflection->getParameters()[0]->getDefaultValueConstantName() . PHP_EOL; echo $reflection->getParameters()[1]->getDefaultValueConstantName() . PHP_EOL; } Expected result: ---------------- PHP_EOL SOME_CONSTANT Actual result: -------------- Some\Name\Space\PHP_EOL Some\Name\Space\SOME_CONSTANT