I’m using Exlipse with Xdebug to debug my php codes, which works well. But there is one type of codes I can’t debug: callback functions
I’m using preg_replace:
$pc = preg_replace('#\[div(=(.*))?\](.*?)\[/div\]#iuUe', "\bbcode_div('\$2', '\$3')", $_POST["data"]);
which calls the function all right, but the eclipse wont get inside the function while debugging, even with a break point.
How can I make the debugger to get inside that function?
EDIT: I need to use preg_replace.
Make sure you’re using
preg_replace_callback():This brakes five times before calling
var_dump().EDIT: Some hackery is required when
preg_replace()is used with theemodifier. In this case, setting a breakpoint is not sufficient. You’d have to explicitly tell XDebug to break: