|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #35821 array_map cause a segfault with throwed exception
Submitted: 2005-12-27 22:43 UTC Modified: 2005-12-27 23:48 UTC
From: sfilteau at kronostechnologies dot com Assigned: tony2001
Status: Closed Package: Reproducible crash
PHP Version: 5.1.1 OS: Gentoo
Private report: No CVE-ID:
 [2005-12-27 22:43 UTC] sfilteau at kronostechnologies dot com
In command line, php do a segfault when calling array_map with a callback function that throw an exception.

Reproduce code:

class Element
        public function ThrowException ()
                echo "This line will do a Segfault : ";
                throw new Exception('How to do a segfault?');

        public static function CallBack(Element $elem)

$arr = array(new Element(), new Element(), new Element());
array_map(array('Element', 'CallBack'), $arr);


Expected result:
This line will do a Segfault : This line will do a Segfault : This line will do a Segfault : 

Actual result:
sylvain@stage ~ $ ./testarraymap.php
This line will do a Segfault : Segmentation fault


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-12-27 23:48 UTC]
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2015 The PHP Group
All rights reserved.
Last updated: Wed Dec 02 05:01:41 2015 UTC