Bug #71400 [NEW]: tested on 5.5.29 php version

From: Date: Sun, 17 Jan 2016 22:39:59 +0000
Subject: Bug #71400 [NEW]: tested on 5.5.29 php version
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-198736@lists.php.net to get a copy of this message
From:             rav dot janisz at gmail dot com
Operating system: linux
PHP version:      5.5.31
Package:          Arrays related
Bug Type:         Bug
Bug description:tested on 5.5.29 php version

Description:
------------
null assignment to a variable and refer to it as an array element does
not return any errors

after assign null to variable var_dump return null and isset return
false, but why in line 5 assign first element of $zonk variable(which is
don't array and don't should exists at all) to next variable doesnt't
return any errors

Test script:
---------------
$zonk = null;            //1
var_dump($zonk);         //2 return null
var_dump(isset($zonk));  //3 return false

$beret = $zonk[0];       //5 don't throw nothing ???
var_dump($beret);        //6 return null
var_dump(isset($beret)); //7 return false

Expected result:
----------------
is line 6 don't should throw something to output error or notice?
or if it is good behavior then in line 3 isset should return true?
or if i'm wrong explain why? becouse i can't figured it out


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



Thread (4 messages)

« previous php.bugs (#198736) next »