php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #74579 No notice
Submitted: 2017-05-12 11:39 UTC Modified: 2017-05-12 12:09 UTC
From: vasoczki dot ferenc at gmail dot com Assigned:
Status: Duplicate Package: Scripting Engine problem
PHP Version: Irrelevant OS: Irrelevant
Private report: No CVE-ID: None
 [2017-05-12 11:39 UTC] vasoczki dot ferenc at gmail dot com
Description:
------------
When initialize a variable as an integer, and later try to dump a non existent key, PHP dump it as null, and do not drop notice.

If you assign string, it drops the notice.

Test script:
---------------
error_reporting(E_ALL);
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
$array = 666;
var_dump($array);
var_dump($array['test']);
$a = $array['test'];
var_dump($a);

Expected result:
----------------
Notice: Undefined index: test

Actual result:
--------------
null

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-05-12 12:09 UTC] narf@php.net
-Status: Open +Status: Duplicate -Package: PHP Language Specification +Package: Scripting Engine problem
 [2017-05-12 12:09 UTC] narf@php.net
Duplicate of https://bugs.php.net/bug.php?id=39915
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Dec 02 20:01:32 2024 UTC