PHP 4.0 Bug #8463: Using internal function in usort call segfaults

From: Date: Thu, 28 Dec 2000 18:13:55 +0000
Subject: PHP 4.0 Bug #8463: Using internal function in usort call segfaults
Groups: php.dev 
Request: Send a blank email to php-dev+get-42456@lists.php.net to get a copy of this message
From: greg@darkphoton.com Operating system: Linux PHP version: 4.0.4 PHP Bug Type: Reproduceable crash Bug description: Using internal function in usort call segfaults Using usort() with an internal function segfaults, for example using strcasecmp() in the usort call will fail, but making a function in php called testcmp() which then calls strcasecmp() works fine. This worked in 4.0.3 and below In the following code snipit, the script will print 1 and 2 but crash before 3. $mblist[0] = "Drafts"; $mblist[1] = "LRP"; $mblist[2] = "Sent Items"; $mblist[3] = "INBOX"; $mblist[4] = "Apache"; $mblist[5] = "Internet"; $mblist[6] = "Lists"; $mblist[7] = "People"; $mblist[8] = "Personal"; Function testcmp( $a, $b ) { return strcasecmp( $a, $b ); } echo "1<BR>"; flush(); usort( $mblist, testcmp ); echo "2"; flush(); usort( $mblist, strcasecmp ); echo "3"; flush(); -- Edit Bug report at: http://bugs.php.net/?id=8463&edit=1

« previous php.dev (#42456) next »