M
M
mrThreeElephants2012-08-31 17:17:51
PHP
mrThreeElephants, 2012-08-31 17:17:51

HipHop PHP not seeing file errors?

For a long time I have been trying to figure out the causes of the problem. The search turned up no results, except for a couple of good musical compositions.
Ubuntu 12.04 system.
The situation is as follows: I downloaded and built from HipHop PHP sources using this instruction: github.com/facebook/hiphop-php/wiki/Building-and-i...
Everything was set up and assembled perfectly.
After that, I launched a static code analysis using this article: habrahabr.ru/post/145683/
The analyzer started up, worked, created the necessary files - but it does not see any errors, no matter what code I analyze.
In order to understand the problem, I specifically created the “errors.php” file:

<?php
// на случай если error_reporting в PHP влияет на работу hiphop
error_reporting(E_ALL); 

// Обращение к необъявленной переменной
$a = $b;

// ошибочный порядок необязательных аргументов
function test($x=false, $y)
{
    // Обращение к локальной необъявленной переменной
    return $value;
}

// Вызов функции с неправильным количеством параметров
test();

// обращение к несуществующей функции
test_bad_function();

// попытка вывести необъявленную переменную
echo $undefined_variable;
?>

Made hiphop PHP parse it with this command:
$HPHP_HOME/src/hphp/hphp  /home/frost/errors.php --output-dir=$OUTPUT_DIR --log=4 --force=1 --keep-tempdir=1 --target=analyze

The result of running the command in the console:
running hphp...
Analyzing Includes
Analyzing All
Corrected function return type Boolean -> Variant
Corrected function return type [0x1] -> Variant
Corrected function return type [0x1] -> Object - iterator
Analyzing Includes
Analyzing All
Analyzing Includes
Analyzing All
parsing inputs...
parsing /home/frost/errors.php ...
Analyzing Includes
Analyzing All
parsing inputs took 0'00" (5 ms) wall time
pre-optimizing...
pre-optimizing took 0'00" (4 ms) wall time
analyze includes...
analyze includes took 0'00" (0 ms) wall time
inferring types...
inferring types took 0'00" (3 ms) wall time
post-optimizing...
post-optimizing took 0'00" (7 ms) wall time
saving code errors and stats...
saving stats...
saving stats took 0'00" (9 ms) wall time
all files saved in /home/frost/hiphop/reports ...
running hphp took 0'00" (195 ms) wall time

As expected, as a result of the analysis, two files were created:
Stats.js and CodeError.js
The contents of Stats.js:
{
"FileCount":1,
"LineCount":19,
"CharCount":546,
"FunctionCount":2,
"ClassCount":0,
"TotalTime":0,
"AvgCharPerLine":28,
"AvgLinePerFunc":9,
"SymbolTypes":
{
    "Array":20,
    "Boolean":8,
    "Double":19,
    "Int64":2248,
    "Object":3,
    "Object - Specific":20,
    "Primitive":13,
    "String":134,
    "Variant":306,
    "_all":2771,
    "_strong":2452,
    "_weak":319
}
,"VariableTableFunctions":[]
}

Most importantly:
Content of CodeError.js:
[0,{}
]

That is, the CodeError.js file always contains 0 errors, regardless of how much code is parsed and how many errors are in the files. Looked through --help but didn't find any options there that would help solve the problem.
Are there any ideas about the reasons for this error?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
pr0tect0r, 2012-09-01
@pr0tect0r

error_reporting(0)?

N
nswbit, 2012-09-03
@nswbit

first, turn on a more detailed log and look at catching errors, maybe none of the available options is simply included in catching?
In general, first a detailed log to the studio

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question