Fix poly-torture to avoid order of eval issues

Normally, hhvm will translate

  echo "x $x";

as

  echo "x ".$x;

Which fully evaluates the rhs, then starts to output it.

hphp will transform it to

  echo "x ", $x;

Which avoids the concat, but outputs "x " before evaluating $x. hphp wont
perform the transformation if there are obvious side effects, but it will
treat a simple variable as having no side effects - even though it may
be uninitialized.

Im just fixing the test by performing the transformation manually. I don't
think anyone cares whether the $x undefined notice appears before or after
the "x ".
Esse commit está contido em:
Mark Williams
2013-04-19 16:54:06 -07:00
commit de Sara Golemon
commit 2294a515f6
2 arquivos alterados com 5 adições e 5 exclusões
+2 -2
Ver Arquivo
@@ -38,7 +38,7 @@ class C {
echo "C::__call $nm\n";
}
function noSuchMethodBoyeee($a, $b, $c, $d, $e) {
echo "C also has this method with params: $d $e\n";
echo "C also has this method with params: ", $d, " ", $e, "\n";
}
}
@@ -62,7 +62,7 @@ class MagicBox {
}
function __call($nm, $arr) {
echo "--";
call_user_func_array(array($this->inner, $nm), $arr);
call_user_func_array(array($this->inner, $nm), $arr);
}
}
+3 -3
Ver Arquivo
@@ -16,9 +16,9 @@ HipHop Warning: noSuchMethodBoyeee() expects exactly 5 parameters, 1 given in %s
HipHop Warning: noSuchMethodBoyeee() expects exactly 5 parameters, 2 given in %s on line 41
HipHop Warning: noSuchMethodBoyeee() expects exactly 5 parameters, 3 given in %s on line 41
HipHop Warning: noSuchMethodBoyeee() expects exactly 5 parameters, 4 given in %s on line 41
HipHop Notice: Undefined variable: d in %s on line 41
HipHop Notice: Undefined variable: e in %s on line 41
C also has this method with params:
C also has this method with params: HipHop Notice: Undefined variable: d in %s on line 41
HipHop Notice: Undefined variable: e in %s on line 41
--C also has this method with params: 3 4
randObj: A
randObj: C