|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-08-10 12:11 UTC] johannes@php.net
-Status: Open
+Status: Bogus
[2010-08-10 12:11 UTC] johannes@php.net
[2010-08-10 12:50 UTC] flyingmana at googlemail dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Dec 15 22:00:02 2025 UTC |
Description: ------------ in a script without namespaces you could took the function name in a string und call it via $string() this does not work, if this function is located in a namespace. The analog case with classes is described as ok in the docs(dont have tested it), so it should also work with functions. So i Request to add this feature. Test script: --------------- <?php namespace bar{ function foo(){ echo "test", "\n"; } function foo2(){ echo "test2", "\n"; } function foo3(){ echo "test3", "\n"; } } namespace{ echo "start \n"; \bar\foo(); use \bar as haha; haha\foo2(); $test = 'haha\foo3'; $test(); } ?> Expected result: ---------------- test test2 test3 Actual result: -------------- test test2 Fatal error: Call to undefined function haha\foo3() in /home/flyingmana/Desktop/sandkasten/namespace.php on line 19