Odd request...

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Odd request...

Post by alex.barylski »

Does anyone know of a hack which can be used to un-declare functions??? :P

I have tried unset() on the array of get_defined_functions() but that just removes the function from that returned array, as it's clearly not a reference to the actual internal array of declared functions, cuz if I try and redefine the unset function...everything still pukes all over me :(

Likely not possible as that was my only thought...but thats why i'm asking for a *hack* inside of PHP no mod C source or anything...this must be PHP code only!!!

Cheers :)
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

You can use the runkit to alter existing functions, but redefining them, not possible in pure php.
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Post by alex.barylski »

Not sure if those will do what I need...

But cooooooooooool 8)

I swear you must spend your evenings reading the PHP docs :P

Know of any nifty debug functions, particularly hooking related?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

runkit and Xdebug in combination?
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Post by alex.barylski »

feyd wrote:runkit and Xdebug in combination?
I'll check it out, thank you :)
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Post by alex.barylski »

feyd wrote:You can use the runkit to alter existing functions, but redefining them, not possible in pure php.
Dude...after close inspection and a quick breather...it does appear as though...runkits are what I am looking for...

not exactly a hook like how I would expect, but it might solve some of the problems...

Wicked cool...thanks man...

You truely are the PHP API bible 8)
Post Reply