View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000723XdebugUsage problems (Wrong Results)public2011-09-30 00:222011-09-30 10:58
Assigned Toderick 
Platformx86_63OSLinux debianOS Version6.0.2
Product Version2.1.0 
Target VersionFixed in Version 
Summary0000723: xdebug is stricter than PHP regarding Exception property types
Descriptionsetting the Exception line value to a string triggers the "Fatal error: Your exception class uses incorrect types for common properties: 'message' and 'file' need to be a string and 'line' needs to be an integer." error

PHP seems to enforce this in the Exception constructor, but lets you set it after the constructor and after that it just works

it looks more like PHP should be more aggressive with this or let it go, but from the outside it looks like xdebug breaks perfectly working PHP
Steps To Reproducethrowing this exception:

class MyException extends Exception {
    function __construct($message) {
        $this->line = "42"; // this triggers it. if it's before the constructor, PHP freaks out regardless of xdebug

with xdebug enabled
Additional Informationfull repro case at [^]
TagsNo tags attached.
Operating Systemlinux debian
PHP Version5.3.7
Attached Files

- Relationships

-  Notes
derick (administrator)
2011-09-30 10:58

Fixed on github for 2.1.3 and 2.2-dev.

- Issue History
Date Modified Username Field Change
2011-09-30 00:23 lkladar New Issue
2011-09-30 10:58 derick Note Added: 0001825
2011-09-30 10:58 derick Status new => closed
2011-09-30 10:58 derick Assigned To => derick
2011-09-30 10:58 derick Resolution open => fixed
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)

Copyright © 2000 - 2019 MantisBT Team
Powered by Mantis Bugtracker