Arquivos
hhvm/hphp/test/quick/debugger/eval2.php
T
Herman Venter 5e215dbca2 $_ not cleared but still printed after exception
The code to print out the result of the expression following the = command has moved from inside the resulting eval block, to outside it in the debugger code itself. Hence, if the eval block fails, the value of $_ now prints out and this is confusion because it is the value that a previous = command put in there. With this change the eval block first unsets $_, so that the subsequent print value code will do nothing in the case of a failure.

Differential Revision: D944120
2013-08-29 11:58:42 -07:00

17 linhas
231 B
PHP

<?php
function foo($x) {
return $x + 1;
}
function throwSomething() {
global $_;
throw new Exception($_);
}
function printSomething() {
global $_;
echo $_;
return "also returned something";
}