|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2004-09-01 20:10 UTC] webmaster at martialartsmovies dot net
Description:
------------
I have PHP 5.0.1 installed together with the latest stable Apache 2 on Windows XP SP2. I used the example on the array_filter page on php.net an all I got was a window telling me that apache caused a problem and it needed to reboot.
Reproduce code:
---------------
<?php
function odd($var)
{
return($var % 2 == 1);
}
function even($var)
{
return($var % 2 == 0);
}
$array1 = array("a"=>1, "b"=>2, "c"=>3, "d"=>4, "e"=>5);
$array2 = array(6, 7, 8, 9, 10, 11, 12);
echo "Odd :\n";
print_r(array_filter($array1, "odd"));
echo "Even:\n";
print_r(array_filter($array2, "even"));
?>
Expected result:
----------------
the array_filter function applied to the 2 arrays
Actual result:
--------------
apache 2 crashed.
error.log:
[Wed Sep 01 19:47:14 2004] [notice] Child 2412: Child process is running
[Wed Sep 01 19:47:14 2004] [notice] Child 2412: Acquired the start mutex.
[Wed Sep 01 19:47:14 2004] [notice] Child 2412: Starting 250 worker threads.
[Wed Sep 01 19:50:15 2004] [notice] Parent: child process exited with status 3221225477 -- Restarting.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 01:00:01 2025 UTC |
I am also getting segfaults using array_filter on Apache 2 (on Gentoo Linux). My backtrace looks like: #0 0x4070246e in zif_array_filter () from /etc/apache/modules/libphp5.so #1 0xbfff3f0c in ?? () #2 0xbfff3f10 in ?? () #3 0xbfff3f14 in ?? () I'm not sure what more I can get from that backtrace. My array filter code looks like: $discs = array_filter(Bb_DiscussionPeer::doSelectUnreadForUserByClique($cliqueId, $uid), array($this, 'hasPerms')); Where the first param to array_filter is an array of objects (verified). And the hasPerms method is a method in parent class that looks like this: protected function hasPerms($obj) { return ($obj->canUser(Perms::READ)); } (Changing that to be a 'public' method doesn't help.) I can't seem to narrow down the bug any more than that. It doesn't seem to happen *all* the time either, but if I have two such similar calls on a page it will segfault. Sometimes it will segfault if there's only one, but sometimes it works without segfaulting.