Bug #74836 [NEW]: isset on zero-prefixed numeric indexes in array broken

From: Date: Fri, 30 Jun 2017 13:46:58 +0000
Subject: Bug #74836 [NEW]: isset on zero-prefixed numeric indexes in array broken
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-209742@lists.php.net to get a copy of this message
From:             sjon at hortensius dot net
Operating system: 3v4l.org
PHP version:      7.2.0alpha2
Package:          Arrays related
Bug Type:         Bug
Bug description:isset on zero-prefixed numeric indexes in array broken

Description:
------------
there seems to be bug when using quoted numeric indexes combined with
isset(). It works without the (redundant) 0 prefix:
https://3v4l.org/NQvXb

Test script:
---------------
See https://3v4l.org/3fXr6


<?php

$a = "1234567890a";
var_dump($a["010"], isset($a["010"])); // true

Expected result:
----------------
string(1) "a"
bool(true)

Actual result:
--------------
string(1) "a"
bool(false)

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



Thread (4 messages)

« previous php.bugs (#209742) next »