The Facebook XHP extension introduces what are basically XML literals (well, XHTML literals) to the PHP language, allowing syntax like the following:
$foo = <div>hello</div>;
$foo = <div>
hello
</div>;
$foo = 'hello';
echo <div>{$foo}</div>; // outputs <div>hello</div>
$foo = 'hello';
echo <div>{substr($foo, 0, 2)}</div>; // outputs <div>he</div>
The biggest problem is that I cannot find an IDE that supports this syntax without flagging it as a syntax error.
I'm told that Facebook generally uses vim or emacs for development but I'm hoping for a more full-blown IDE that supports this syntax. At present, Netbeans 6.9, 7.0 M2, and Zend Studio 8 all flag this syntax as an error even though it executes fine on PHP with the XHP extension enabled.
Suggestions for an editor or plugin to an editor that allows this to work without syntax errors?
Info about XHP: https://github.com/facebook/xhp/wiki
Try netbeans, go to Tools
> Options
find tab Miscellaneous
> Files
. Choose your Extension
or click new. Remember insert ignored files pattern
should be insert, if not you will get error syntax.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With