|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-11-05 16:02 UTC] dzenovich at gmail dot com
[2009-11-06 04:51 UTC] dzenovich at gmail dot com
[2013-02-23 18:56 UTC] pollita@php.net
-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: pollita
[2013-02-23 18:56 UTC] pollita@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 07:00:01 2025 UTC |
Description: ------------ affects runkit 0.9: I'm using runkit_function_redefine to redefine a system function (passthru). I would like to be able to intercept the parameters passed to this function in old_passthru. For some files, the code bellow is working great. However, if you have an PHP file with any function defined, runkit returns an Fatal error: Cannot redeclare my_function(). If the function is commented out, it's working fine. Reproduce code: --------------- File /var/www/tr/index.php --------------- <?php function my_function() { } // redefine passthru runkit_function_copy('passthru','old_passthru'); runkit_function_redefine( 'passthru', // function to redefine '', // number of parameters // code ' $args = func_get_args(); echo "<b>passthru</b> params = [<b>" . func_get_arg (0) . "</b>]<br>"; return call_user_func_array("old_passthru", $args); ' ); // call passthru passthru("ls"); ?> <i><br> this is html already </i> Expected result: ---------------- passthru params = [ls] index.php phpinfo.php runkit.php this is html already Actual result: -------------- Fatal error: Cannot redeclare my_function() (previously declared in /var/www/tr/index.php:4) in /var/www/tr/index.php on line 4