Edit report at https://bugs.php.net/bug.php?id=63088&edit=1
ID: 63088
User updated by: daniel dot rudolf at eifel-online dot com
Reported by: daniel dot rudolf at eifel-online dot com
Summary: <> operator matches different on CLI -r vs. CLI -f
Status: Open
Type: Bug
Package: Scripting Engine problem
Operating System: Windows XP
PHP Version: 5.3.17
Block user comment: N
Private report: N
New Comment:
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)
Previous Comments:
------------------------------------------------------------------------
[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