1

I use Ubuntu 12.04 (64 bit).

I have compiled hipHop from the source using this manual: https://github.com/facebook/hiphop-php/wiki/Building-and-installing-HHVM-on-Ubuntu-12.04

hphp runs fine, but I always see my CodeError.js like this:

[0,{}
]

In order to understand what was going on I created an "errors.php" file:

<?php
// just in case
error_reporting(E_ALL);

// undefined variable
$a = $b;

// wrong optional params order
function test($x=false, $y)
{
    // undefined variable
    return $value;
}

// wrong function call
test();

// undefined function call, etc...
test_bad_function();

echo $undefined_variable;
?>

After that I make HipHop analyze the file, using command:

$HPHP_HOME/src/hphp/hphp  /home/frost/errors.php --output-dir=$OUTPUT_DIR --log=4 --force=1 --keep-tempdir=1 --target=analyze

Console output:

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

HipHop has created 2 files: Stats.js and CodeError.js

Stats.js contents:

{
"FileCount":1,
"LineCount":21,
"CharCount":363,
"FunctionCount":2,
"ClassCount":0,
"TotalTime":0,
"AvgCharPerLine":17,
"AvgLinePerFunc":10,
"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":[]
}

CodeError.js contents:

[0,{}
]

How can it be? Did I miss something?


And interesting fact: Stats.js creates every time, even if I set --gen-stats=0

countTheRow
  • 141
  • 8

0 Answers0