php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #41210 unexpected behaviour on access null as an associative array
Submitted: 2007-04-27 07:43 UTC Modified: 2007-04-27 08:03 UTC
From: bgoldschmidt at rapidsoft dot de Assigned:
Status: Not a bug Package: Feature/Change Request
PHP Version: 5.2.1 OS: debian
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: bgoldschmidt at rapidsoft dot de
New email:
PHP Version: OS:

 

 [2007-04-27 07:43 UTC] bgoldschmidt at rapidsoft dot de
Description:
------------
Trying to access null as an associative array works just fine and doesn't result in an error, as it should.

Reproduce code:
---------------
<?php

$testarray = null;

$a = $testarray['test'];  // this should yield to an error

echo('$a = '.$a); // outputs '$a = '

?>

Expected result:
----------------
An error.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-04-27 08:03 UTC] johannes@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Jul 15 08:01:31 2025 UTC