Doc #71800 [NEW]: string checks is_array enters into if and makes that string null

From: Date: Fri, 11 Mar 2016 12:32:28 +0000
Subject: Doc #71800 [NEW]: string checks is_array enters into if and makes that string null
Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-13315@lists.php.net to get a copy of this message
From: muhammadhu dot aiman at gmail dot com Operating system: Ubuntu 15.04 PHP version: 5.6Git-2016-03-11 (snap) Package: Arrays related Bug Type: Documentation Problem Bug description:string checks is_array enters into if and makes that string null Description: ------------ --- From manual page: http://www.php.net/function.is-array --- although only array should become true and should enter inside the if, but strings enter into the is_array() and string is converted into null array. Test script: --------------- //a string is passed to the checkString protected function checkString($str) if(is_array($str)) { //only arrays allowed here but string goes into if var_dump($str);exit; //string enters here and $str becoumes a null array } else { echo 'ok'; } } result is array(0) { } Expected result: ---------------- protected function checkString($str) if(is_array($str)) { //only arrays allowed here but string goes into if var_dump($str);exit; //string enters here and $str becoumes a null array } else { echo 'ok'; } } result should be 'ok' Actual result: -------------- array(0) { } -- Edit bug report at https://bugs.php.net/bug.php?id=71800&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=71800&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=71800&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=71800&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=71800&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=71800&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=71800&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=71800&r=needscript Try newer version: https://bugs.php.net/fix.php?id=71800&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=71800&r=support Expected behavior: https://bugs.php.net/fix.php?id=71800&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=71800&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=71800&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=71800&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=71800&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=71800&r=dst IIS Stability: https://bugs.php.net/fix.php?id=71800&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=71800&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=71800&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=71800&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=71800&r=mysqlcfg

« previous php.doc.bugs (#13315) next »