php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #67149 Every array index of a NULL value exists
Submitted: 2014-04-28 21:10 UTC Modified: 2014-04-28 21:28 UTC
From: lezso69 at gmail dot com Assigned:
Status: Duplicate Package: Arrays related
PHP Version: 5.5.11 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
31 + 31 = ?
Subscribe to this entry?

 
 [2014-04-28 21:10 UTC] lezso69 at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/language.types.null
---

When I assign a NULL value to a variable, and access it as an array, I got no warning.

Test script:
---------------
<?php
$notarray = null;
var_dump($notarray[0]);

Expected result:
----------------
Some warning should be shown.

Actual result:
--------------
Just returns NULL.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-04-28 21:28 UTC] requinix@php.net
-Status: Open +Status: Duplicate -Type: Bug +Type: Feature/Change Request
 [2014-04-28 21:28 UTC] requinix@php.net
See bug #62769.
 [2014-04-28 21:28 UTC] requinix@php.net
-Type: Feature/Change Request +Type: Bug
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 04:01:28 2024 UTC