|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2011-04-13 11:54 UTC] johannes@php.net
-Status: Open
+Status: Bogus
[2011-04-13 11:54 UTC] johannes@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 30 16:00:01 2025 UTC |
Description: ------------ Using php 5.3.3-1 array_map needs to have the namespace included in the callback despite being called from within the same namespace. This came up with OAuth.php. Example: Test script: --------------- namespace mynamespace; class OAuthUtil {/*{{{*/ public static function urlencode_rfc3986($input) {/*{{{*/ if (is_array($input)) { return array_map(array('OAuthUtil','urlencode_rfc3986'), $input); } else if (is_scalar($input)) { return str_replace('+', ' ', str_replace('%7E', '~', rawurlencode($input))); } else { return ''; } }/*}}}*/ } Expected result: ---------------- It should work the same as if the namespace were specified in the callback, but it doesn't: namespace mynamespace; class OAuthUtil {/*{{{*/ public static function urlencode_rfc3986($input) {/*{{{*/ if (is_array($input)) { return array_map(array('\mynamespace\OAuthUtil','urlencode_rfc3986'), $input); } else if (is_scalar($input)) { return str_replace('+', ' ', str_replace('%7E', '~', rawurlencode($input))); } else { return ''; } }/*}}}*/ } Actual result: -------------- It does not find the function that it should.