|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2016-10-16 12:13 UTC] castarco at litipk dot com
[2016-10-18 12:04 UTC] cmb@php.net
-Status: Open
+Status: Feedback
-Assigned To:
+Assigned To: cmb
[2016-10-18 12:04 UTC] cmb@php.net
[2016-10-30 04:22 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 23 08:00:02 2025 UTC |
Description: ------------ I won't provide a test script because to test this bug we need to use many files. Assumptions: 1. I have a function placed in some file, following the PSR-4 conventions. 2. I'm using Composer, and I force the autoloading of the file where I put the functions. 3. I import it using something like: use function MyNamespace\functionName as myLocalFunction; 4. I check that the autoload has been done, I can directly call the function without problems: myLocalFunction($x); 5. I can pass that function as a callable, but only with its fully qualified name: array_filter($myData, 'MyNamespace\\functionName'); 6. I cannot pass that function using the "local name": array_filter($myData, 'myLocalFunction'); // This will crash 7. Even if I don't use aliasing whilst importing the function, the crash happens too. Actual result: -------------- array_filter() expects parameter 2 to be a valid callback, function 'myLocalFunction' not found or invalid function name