* Set EnableHipHopSyntax=true to enable string and integer type hints. I gave the file a .hphp extension to avoid false alarms in syntax checking scripts. * Made sure almost all the local variables in preprocessToObj() have a specific type, instead of being variants. This is useful for integers, but has the largest impact for objects, since dynamic method calls can be avoided. * Stopped using extract() since it forces all local variables to be variants, and adds some hashtable initialisation overhead. * Found a way to cast a variant to a specific object class, by abusing argument type hinting. The method does not require special syntax; it is harmless in Zend PHP. * Wrapped various internal function calls with type casts. strspn() and substr() need to be wrapped with intval() and strval() respectively, since they return a variant to support special error return values. HipHop isn't smart enough to know whether the error case will be triggered. * Replaced most instances of double-equals with triple-equals. Profiling indicates that this makes a very large difference when comparing strings, much more so than in Zend. |
||
|---|---|---|
| .. | ||
| CoreLinkFunctions.php | ||
| CoreParserFunctions.php | ||
| CoreTagHooks.php | ||
| DateFormatter.php | ||
| LinkHolderArray.php | ||
| Parser.php | ||
| Parser_DiffTest.php | ||
| Parser_LinkHooks.php | ||
| ParserCache.php | ||
| ParserOptions.php | ||
| ParserOutput.php | ||
| Preprocessor.php | ||
| Preprocessor_DOM.php | ||
| Preprocessor_Hash.php | ||
| Preprocessor_HipHop.hphp | ||
| StripState.php | ||
| Tidy.php | ||