Doc #64453 [NEW]: array_key_exists function
From: billsion at gmail dot com
Operating system: Windows
PHP version: 5.3.23
Package: Online Doc Editor problem
Bug Type: Documentation Problem
Bug description:array_key_exists function
Description:
------------
---
From manual page:
http://www.php.net/function.array-key-exists#refsect1-function.array-key-exists-description
---
array_key_exists function accept two parameters, the first one is "Mixed"
which is tell in the documentation, but it gives a warning : 'it must be
string or integer'. there should not display any warning even I set the
error_reporting is "E_ALL | E_STRICT".
Test script:
---------------
<?php
$key = array('trade_mode', 'trade_state');
$params['trade_mode'] = 1;
$params['trade_state'] = 1;
$params['a'] = 1;
$params['b'] = 1;
if(array_key_exists($key, $params)){
echo 1;
}else{
echo 2;
}
exit;
Expected result:
----------------
1
Actual result:
--------------
Warning: array_key_exists() [function.array-key-exists]: The first argument
should be either a string or an integer in D:\www\index.php on line 9
2
--
Edit bug report at https://bugs.php.net/bug.php?id=64453&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=64453&r=trysnapshot54
Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=64453&r=trysnapshot53
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=64453&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=64453&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=64453&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=64453&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=64453&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=64453&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=64453&r=support
Expected behavior: https://bugs.php.net/fix.php?id=64453&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=64453&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=64453&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=64453&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=64453&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=64453&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=64453&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=64453&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=64453&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=64453&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=64453&r=mysqlcfg
Thread (2 messages)
- billsion at gmail dot com