Bug #62653 [NEW]: unset(array($foo)) crashes apache depending on $foo

From: Date: Tue, 24 Jul 2012 16:16:06 +0000
Subject: Bug #62653 [NEW]: unset(array($foo)) crashes apache depending on $foo
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-172212@lists.php.net to get a copy of this message
From:             davidso1 at rose-hulman dot edu
Operating system: Windows Server
PHP version:      5.4.5
Package:          Apache2 related
Bug Type:         Bug
Bug description:unset(array($foo)) crashes apache depending on $foo

Description:
------------
The test code crashes apache in the 5.4+ environment.
$foo starts as a string, gets interpreted as a double but it isn't I
guess.

unset($array[(double) $foo]) works as expected

Test script:
---------------
$array = array("5"=>"bar");
$foo = "10.0000"; // gettype($foo) = "string"
$foo /= 2; //Makes $foo = 5 but still gettype($foo) = "double"
unset($array[$foo]);
print_r($array);

Expected result:
----------------
Array()

Actual result:
--------------
Error 101 (net::ERR_CONNECTION_RESET): The connection was reset.

-- 
Edit bug report at https://bugs.php.net/bug.php?id=62653&edit=1
-- 
Try a snapshot (PHP 5.4):            https://bugs.php.net/fix.php?id=62653&r=trysnapshot54
Try a snapshot (PHP 5.3):            https://bugs.php.net/fix.php?id=62653&r=trysnapshot53
Try a snapshot (trunk):              https://bugs.php.net/fix.php?id=62653&r=trysnapshottrunk
Fixed in SVN:                        https://bugs.php.net/fix.php?id=62653&r=fixed
Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=62653&r=needdocs
Fixed in release:                    https://bugs.php.net/fix.php?id=62653&r=alreadyfixed
Need backtrace:                      https://bugs.php.net/fix.php?id=62653&r=needtrace
Need Reproduce Script:               https://bugs.php.net/fix.php?id=62653&r=needscript
Try newer version:                   https://bugs.php.net/fix.php?id=62653&r=oldversion
Not developer issue:                 https://bugs.php.net/fix.php?id=62653&r=support
Expected behavior:                   https://bugs.php.net/fix.php?id=62653&r=notwrong
Not enough info:                     https://bugs.php.net/fix.php?id=62653&r=notenoughinfo
Submitted twice:                     https://bugs.php.net/fix.php?id=62653&r=submittedtwice
register_globals:                    https://bugs.php.net/fix.php?id=62653&r=globals
PHP 4 support discontinued:          https://bugs.php.net/fix.php?id=62653&r=php4
Daylight Savings:                    https://bugs.php.net/fix.php?id=62653&r=dst
IIS Stability:                       https://bugs.php.net/fix.php?id=62653&r=isapi
Install GNU Sed:                     https://bugs.php.net/fix.php?id=62653&r=gnused
Floating point limitations:          https://bugs.php.net/fix.php?id=62653&r=float
No Zend Extensions:                  https://bugs.php.net/fix.php?id=62653&r=nozend
MySQL Configuration Error:           https://bugs.php.net/fix.php?id=62653&r=mysqlcfg



Thread (9 messages)

« previous php.bugs (#172212) next »