ID:               46112
 User updated by:  erikg at codepoet dot no
 Reported By:      erikg at codepoet dot no
 Status:           Open
 Bug Type:         Reproducible crash
 Operating System: ArchLinux
 PHP Version:      5.2.6
 New Comment:

Oops, the $item variables weren't supposed to be there. Doesn't matter
though, the segfault still triggers.


Previous Comments:
------------------------------------------------------------------------

[2008-09-18 10:04:08] erikg at codepoet dot no

Description:
------------
Apache segfaults when throwing an exception in a function whose return
value is used to construct a class within another class' constructor.

That sentence made my head hurt, just read the code :) I haven't been
able to remove any code while still reproducing the crash.

Reproduce code:
---------------
function error($item) {
        throw new Exception("error");
}

class Foo {
        function __construct() {
                new Bar(error($item));
        }
}

class Bar {
        function __construct($param) {
        }
}

new Foo();

Expected result:
----------------
Foo object to be instantiated

Actual result:
--------------
Apache segfaults


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=46112&edit=1

Reply via email to