<h2>Inconsistenties</h2>

These are the known inconsistencies between current HPHP and PHP.

1. Operators

(1) instanceof

In PHP, [constant] instanceof [class name] will cause a fatal.
In HPHP, there is no special case for constants and the expression's value is
false.

2. Classes and objects

(1) Exceptions thrown from destructors

In HPHP, exceptions and fatals thrown from destructors will be swallowed while
logging an error. Effectively, there is a try/catch enclosing the body of the
__destruct method. These exceptions are catchable in PHP outside of the
__destruct method.

(2) Private properties are shared throughout class hierarchy

In PHP, every class in a class hierarchy could define a private property
with the same name and have these properties be treated distinctly.
In HPHP, there is only one instance of the property that is shared by all
classes in the hierarchy.

(3) Private and protected properties and __get

In PHP, __get will be called if a property cannot be accessed from the
context of the object property expression.
In HPHP, __get will be called only if the property does not exist at all.
The interpreter will throw a fatal, and the compiler will silently ignore
the class privacy violation.

(4) unset

In PHP, a data member that is unset will not appear at all in vardump or
serialize.
In HPHP, it will still appear, as null.

3. Eval Issues

(1) eval

Is only supported in limited circumstances.
Example unsupported case: phpt...bug21960

(2) create_function

is only supported with literal arguments
Example unsupported case: phpt...bug22690

(3) preg_replace /e

is only supported in limited cases.
Example unsupported case: phpt...bug24403

4. Dynamic declared globals

are not supported, e.g. (phpt...bug24396)

  global $$k;
  $$k = $v;

5. Dynamic declared constants

are not supported, e.g.

  define($name, $value);

6. Misc

(1) get_declared_classes

Can return classes in different order from PHP's.

(2) uninitialized variables

If an uninitialized variable is being used before it's assigned with a value,
and this variable is inferred as integers, it will be 0, instead of null.

(3) calling a function with wrong number of parameters

Currently it's a fatal, and we should change it to warnings as what PHP does.
This only applies to functions that don't have variable arguments, meaning
func_get_arg() or func_get_args() is not called inside the function.
