-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong boolean behavior #4007
Comments
My local master tests agree, but 3v4l disagrees (http://3v4l.org/gZ3TP). Local script/output:
PHP
HHVM
|
Yes it is strange that 3v4l is ok. I tested on 3 machines + travis - all results was wrong |
Seems somehow related to <?php
$x = ((strtolower("no") === "no"));
var_dump($x);
$x = (!(strtolower("no") === "no"));
var_dump($x);
var_dump(!(strtolower("no") === "no"));
var_dump(((strtolower("no") === "no")));
// Everything down below works
echo "\n";
$x = (("no" === "no"));
var_dump($x);
$x = (!("no" === "no"));
var_dump($x);
var_dump(!("no" === "no"));
var_dump((("no" === "no")));
echo "\n";
$no = "no";
$no2 = "no";
var_dump(!(++$no === ++$no2));
var_dump(((++$no === ++$no2))); |
no, strtolower works as expected, i add more tests |
I suppose problem somewhere in code translation/optimization |
Hmmm.... I am having trouble repoing this. At first I thought it might be a JIT vs. interp issue, but on master, both are returning
|
I can't reproduce this anymore. |
Test code is:
should be
false
, but gottrue
on all 3.* versions. Pure php 5.* outputsfalse
Tests: https://travis-ci.org/imsamurai/hhvm-test
The text was updated successfully, but these errors were encountered: