|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2012-09-14 09:12 UTC] daniel dot rudolf at eifel-online dot com
[2012-09-14 09:42 UTC] laruence@php.net
-Status: Open
+Status: Not a bug
[2012-09-14 09:42 UTC] laruence@php.net
[2012-09-14 09:53 UTC] laruence@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 23 05:00:01 2025 UTC |
Description: ------------ The <> operator matches different when passing code directly to CLI mode using the -r parameter vs. a file using the -f parameter. Test script: --------------- php.exe -r "error_reporting(0); $a = array('parent' => array('existing' => '0')); var_dump($a['notExisting'] <> "0"); var_dump($a['notExisting'] <> $a['parent']['existing']);" --- vs. --- php.exe -f test.php with test.php has the contents: <?php error_reporting(0); $a = array('parent' => array('existing' => '0')); var_dump($a['notExisting'] <> "0"); var_dump($a['notExisting'] <> $a['parent']['existing']); ?> Expected result: ---------------- bool(true) bool(true) --- vs. --- bool(false) bool(true) Actual result: -------------- bool(false) bool(true) --- vs. --- bool(false) bool(true)