View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0001081 | Xdebug | Uncategorized | public | 2014-10-29 17:09 | 2014-11-11 20:49 |
| Reporter | bananer | Assigned To | |||
| Priority | normal | Severity | minor | Reproducibility | always |
| Status | resolved | Resolution | not fixable | ||
| Product Version | 2.2.4 | ||||
| Summary | 0001081: Breakpoints change PHP behavior | ||||
| Description | Hi all, I've been questioning my sanity today, it seems like setting a breakpoint changes PHP's behavior when comparing DateTimeZone objects. Here is a very basic script that was enough to reproduce the problem for me: <?php $tz1 = new DateTimeZone('Europe/Berlin'); $d = new DateTime('2014-12-24 13:00:00', $tz1); if($tz2 == $d->getTimezone()) { What I observed: When ran without Xdebug or with no breakpoints set, the script prints "yes", just as expected. But when I set a breakpoint in line 6 ("$d = ..."), the script will print "no". The same can be seen when the breakpoint is in the very first line and I step over until the end, but not when resuming execution right from the breakpoint at the top. So it has to break in line 6 for the problem to show. I have tested this on my main machine with Ubuntu 14.04, PHP 5.5.9, Xdebug 2.2.3 and using PHPStorm as debugger frontend. Since this was driving me crazy, I set up a fresh Ubuntu 14.10 VM with PHP 5.5.9 and Xdebug 2.2.4 using Eclipse, and could see the same problem, so it seems like this is not something wrong with my setup. A remote_log file from inside the VM is attached. I hope somebody can figure out what is wrong here... | ||||
| Tags | No tags attached. | ||||
| Operating System | Ubuntu 14.04 and 14.10 | ||||
| PHP Version | 5.5.5-5.5.9 | ||||
|
|
There is a bug here, but it is not in Xdebug. It is in PHP instead. Just run <?php $tz1 = new DateTimeZone('Europe/Berlin'); $d = new DateTime('2014-12-24 13:00:00', $tz1); if($tz2 == $d->getTimezone()) { I've only added the var_dump(...) in there compared to your script. Xdebug |