From: cdragon at draconic dot com
Operating system: Windows 2000 Server
PHP version: 4CVS-2003-09-30 (stable)
PHP Bug Type: Variables related
Bug description: extract($GLOBALS, EXTR_REFS); can corrupt the $GLOBALS array.

Using extract($GLOBALS, EXTR_REFS); can cause the left hand side of two
globals set "by-value" equal to one-another to become corrupted in the
$GLOBALS array. Hard to explain in English, but easier to see in the code

Reproduce code:
$sortColumn = "Affinity";
// Using "$lastSortColumn = substr($sortColumn, 0);" fixes the bug
$lastSortColumn = $sortColumn;

print "sort=" . $GLOBALS['sortColumn'] . " lastsort=" .
$GLOBALS['lastSortColumn'] . "<p>";
print "sort=" . $GLOBALS['sortColumn'] . " lastsort=" .
$GLOBALS['lastSortColumn'] . "<p>";

function extractGlobs()
// Commenting out the line below fixes the bug. So does not using the

Expected result:
sort=Affinity lastsort=Affinity
sort=Affinity lastsort=Affinity

Actual result:
sort=Affinity lastsort=Affinity
sort=Affinity lastsort=

or, randomly, you get an access violation instead:

PHP has encountered an Access Violation at 02CFF32F
(the 02CFF32F is variable)

Edit bug report at [url][/url]
Try a CVS snapshot (php4): [url][/url]
Try a CVS snapshot (php5): [url][/url]
Fixed in CVS: [url][/url]
Fixed in release: [url][/url]
Need backtrace: [url][/url]
Try newer version: [url][/url]
Not developer issue: [url][/url]
Expected behavior: [url][/url]
Not enough info: [url][/url]
Submitted twice: [url][/url]
register_globals: [url][/url]
PHP 3 support discontinued: [url][/url]
Daylight Savings: [url][/url]
IIS Stability: [url][/url]
Install GNU Sed: [url][/url]
Floating point limitations: [url][/url]