View Issue Details

IDProjectCategoryView StatusLast Update
0000955XdebugFeature/Change requestpublic2016-12-14 08:55
ReporternajcikAssigned Toderick 
Status assignedResolutionopen 
Product Version 
Target VersionFixed in Version 
Summary0000955: provide a profiler API for xdebug
DescriptionIn the .NET world there's something called profiler API. This extension is very low level (in terms of .NET code) but it gives programmers very interesting features: it allows for example to register callbacks on any function, method invocation or property access. It's like events for function calls: onCall, onReturn etc. - with the ProfilerAPI you could for example skip the call, modify its return value, fiddle with its parameters and the like or stub the whole invocation with a function of your choice.
Of course in terms of xdebug it would allow to create listeners to build one's own tool sets for tracking and examining call graphs and the like. Right now we are stuck with the tracking file xdebug generates.
My motivation for such an extension would be different though: one of the limitation of PHP language is that it is very difficult to mock or stub any static, final functions. Such extension would allow for a completely new generation of isolation (mock) frameworks with similar capabilities like those of Typemock Isolator but in the PHP world.

Ideally the hooks could be used from the PHP Code e.g. regular php code to be registered as onCall or onReturn handlers.
TagsNo tags attached.
Operating System
PHP Version5.1.0



2013-06-25 13:54

reporter   ~0002523

Here's how the profiler API was exploited at Typemock.


2016-12-13 21:11

administrator   ~0004045

Are you still interested in this? I have not had anybody else ask about it, and I also don't really feel like this is a debugging tool. It is much more like runkit or something like that.


2016-12-14 08:55

reporter   ~0004064

Thanks for taking time to review this suggestion.
Well while I appreciate your point that this proposal goes beyond what's traditionally considered a debugging feature on the other hand if a debugger was not able to "peek'n'poke" program variables? By changing a variable value you alternate the control flow. Why would that be so much different from changing the program itself which by the way is considered data as well in some programing paradigms?

Issue History

Date Modified Username Field Change
2013-06-25 13:40 najcik New Issue
2013-06-25 13:54 najcik Note Added: 0002523
2016-12-13 21:11 derick Note Added: 0004045
2016-12-13 21:11 derick Assigned To => derick
2016-12-13 21:11 derick Status new => feedback
2016-12-14 08:55 najcik Note Added: 0004064
2016-12-14 08:55 najcik Status feedback => assigned