|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-12-27 23:48 UTC] tony2001@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 04:00:02 2025 UTC |
Description: ------------ In command line, php do a segfault when calling array_map with a callback function that throw an exception. Reproduce code: --------------- <?php 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) { $elem->ThrowException(); } } $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