|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2011-10-27 07:17 UTC] sebastian@php.net
-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: sebastian
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 05:00:01 2025 UTC |
Description: ------------ This is a request for a Runkit function that adds PHP code either at the beginning or at the end of an already defined function or method. This can currently be achieved by the following runkit_method_rename('Foo', 'bar', '__bar'); runkit_method_add('Foo', 'bar', '', "echo 'Hello '; Foo::__bar(); echo '!';"); but a convenience function for this would be nice. Reproduce code: --------------- <?php class Foo { public function bar() { print 'World'; } } runkit_method_prepend_code('Foo', 'bar', "print 'Hello ';"); runkit_method_append_code('Foo', 'bar', "print '!';"); $foo = new Foo; $foo->bar(); ?> Expected result: ---------------- Hello World.