Bug #74579 [Opn->Dup]: No notice

From: Date: Fri, 12 May 2017 12:09:31 +0000
Subject: Bug #74579 [Opn->Dup]: No notice
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-209084@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=74579&edit=1 ID: 74579 Updated by: narf@php.net Reported by: vasoczki dot ferenc at gmail dot com Summary: No notice -Status: Open +Status: Duplicate Type: Bug -Package: PHP Language Specification +Package: Scripting Engine problem Operating System: Irrelevant PHP Version: Irrelevant Block user comment: N Private report: N New Comment: Duplicate of https://bugs.php.net/bug.php?id=39915 Previous Comments: ------------------------------------------------------------------------ [2017-05-12 11:39:21] 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 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=74579&edit=1

« previous php.bugs (#209084) next »