Anonymous | Login | Signup for a new account | 2018-04-25 05:45 BST | ![]() |
My View | View Issues | Change Log | Roadmap |
View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||||||
0000958 | Xdebug | Usage problems (Wrong Results) | public | 2013-07-04 15:42 | 2017-03-19 22:15 | ||||||||
Reporter | ericol | ||||||||||||
Assigned To | derick | ||||||||||||
Priority | normal | Severity | minor | Reproducibility | always | ||||||||
Status | resolved | Resolution | won't fix | ||||||||||
Platform | OS | OS Version | |||||||||||
Product Version | 2.2.1 | ||||||||||||
Target Version | Fixed in Version | ||||||||||||
Summary | 0000958: XDebug doesn't breakpoint at code called by preg_replace (Might affect other functions) | ||||||||||||
Description | If you make preg_replace call a function when replacing some text, any breakpoint set in the function isn't honoured. | ||||||||||||
Steps To Reproduce | In this code, place a breakpoint in line 5 ("echo $txt") and another in line 8 ("return 'h';"). Execution stops at line 5, but not at line 8. <?php $txt="AaAaAaAaAa"; $txt=preg_replace(array('/[a-z]/e'), array("replace(\"$1\")"), $txt); echo $txt; function replace($txt) { return 'h'; } ?> | ||||||||||||
Tags | Doesn't Break | ||||||||||||
Operating System | Windows 7 | ||||||||||||
PHP Version | 5.3.1 | ||||||||||||
Attached Files | ![]() | ||||||||||||
![]() |
|
(0002533) derick (administrator) 2013-07-09 08:59 |
Could you create an accompanying remote debugging log with such a debugging session with that script? You can make one by turning on xdebug.remote_log=c:\temp\xdebug.log (or similar name of course). |
(0002553) ericol (reporter) 2013-08-06 18:51 |
Hey, apologies on the late response. I saw the email and thought about doing that later, and then completely forgot about it. Attached is the log, hope that helps. |
(0002573) derick (administrator) 2013-10-09 19:36 |
I've had a look at this and I can see what is wrong. Requires hackyness for preg replace and "regexp code" in filename checks. |
(0004236) derick (administrator) 2017-03-19 22:15 |
I had a look at this again, and the /e modifier is no longer available in PHP 7.x for preg_replace - instead, you need to use preg_match_replace. As this is sort of a new feature, which would only apply for PHP 5, I have decided not to add this new "hacky" functionality that relies on string matching a filename. |
![]() |
|||
Date Modified | Username | Field | Change |
2013-07-04 15:42 | ericol | New Issue | |
2013-07-04 15:42 | ericol | Tag Attached: Doesn't Break | |
2013-07-09 08:59 | derick | Note Added: 0002533 | |
2013-07-09 08:59 | derick | Assigned To | => derick |
2013-07-09 08:59 | derick | Status | new => feedback |
2013-08-06 18:50 | ericol | File Added: xdebug.zip | |
2013-08-06 18:51 | ericol | Note Added: 0002553 | |
2013-08-06 18:51 | ericol | Status | feedback => assigned |
2013-10-09 19:36 | derick | Note Added: 0002573 | |
2016-07-31 13:36 | derick | Category | Usage problems => Usage problems (Crashes) |
2016-07-31 13:38 | derick | Category | Usage problems (Crashes) => Usage problems (Wrong Results) |
2016-11-28 20:59 | derick | Status | assigned => confirmed |
2017-03-19 22:15 | derick | Note Added: 0004236 | |
2017-03-19 22:15 | derick | Status | confirmed => resolved |
2017-03-19 22:15 | derick | Resolution | open => won't fix |
Copyright © 2000 - 2018 MantisBT Team |