Edit report at https://bugs.php.net/bug.php?id=63088&edit=1
ID: 63088 Updated by: larue...@php.net Reported by: daniel dot rudolf at eifel-online dot com Summary: <> operator matches different on CLI -r vs. CLI -f Status: Not a bug Type: Bug Package: Scripting Engine problem Operating System: Windows XP PHP Version: 5.3.17 Block user comment: N Private report: N New Comment: or: php.exe -r "var_dump(NULL <> '0');" Previous Comments: ------------------------------------------------------------------------ [2012-09-14 09:42:19] larue...@php.net Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php in cmd, you should write two quotes(escape) in the quote string: php.exe -r "var_dump(NULL <> "0");" should be: php.exe -r "var_dump(NULL <> ""0"");" otherwise, I guess CMD will take it as: php.exe -r "var_dump(NULL <> 0);" ------------------------------------------------------------------------ [2012-09-14 09:12:47] daniel dot rudolf at eifel-online dot com Damn... Sorry, I copied the results wrong... Expected result: ---------------- bool(true) bool(true) --- vs. --- bool(true) bool(true) Actual result: -------------- bool(false) bool(true) --- vs. --- bool(true) bool(true) ------------------------------------------------------------------------ [2012-09-14 09:10:32] daniel dot rudolf at eifel-online dot com 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) ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=63088&edit=1