Arquivos
hhvm/hphp/test/quick/hhir_eq_stack.php
T
Mark Williams 29ff6382e2 Prevent an equality check from being optimized away
We were depending on a side effect of the string conversion
2013-04-22 14:18:05 -07:00

23 linhas
345 B
PHP

<?php
class Foo {
public function __toString() { some(); }
}
function some() {
throw new Exception('bye');
}
function wat() {
$z = 'asd' . mt_rand();
$k = new Foo();
$l = array($z, $z);
$y = $k == $z;
$k = null;
return $y;
}
try { wat(); }
catch (Exception $ex) { echo "Caught: " . $ex->getMessage() . "\n"; }
echo "done\n";