5 ms·
I work at Hyves and wrote this article. If you have any questions on our use of Hiphop, please ask here and I will try to answer any questions.
by willemst 15y ago
I work at Hyves and wrote this article. If you have any questions on our use of Hiphop, please ask here and I will try to answer any questions.
- z92 15y agoIs there a list of functions and features that doesn't work with Hiphop?
- willemst 15y agoNamespaces don't work very well, all functions that create dynamic code (code that is not known at compile time) don't work (eval(), create_function(), preg_replace() with 'e' modifier). Don't define constants where the name of the constant is a variable, as in "define($key, $value)" Don't use "current($a)" to get the first element of an array $a, but use "reset($a)". current returns whatever element the internal array pointer points to, and PHP changes that pointer in crazy/undefined ways. Hiphop has a saner way to handle that pointer, but it's not the same as in PHP so your code might break if it's dependent on the specificities of PHP. In general use current only in case you are explicitly handling the internal pointer (that is, you are also calling reset/next). Under the compiled version of hiphop, class_exists returns true for (almost) all the classes even if you haven't already included the file where they are defined, since they are all statically compiled. Don't rely on destructors being called at the end of the requests: under hiphop they aren't. So either the object happens to be destructed during request execution (due to its reference count going to 0), in which case the destructor is called, or the object is garbage collected at the end of the request and its destructor is just ignored. There are some differences in the handling of SOAP errors in Hiphop. This will give a fatal error in Hiphop but not PHP: $z = null, $z[0] = "foo"; You can consult these Hiphop docs: https://github.com/facebook/hiphop-php/raw/master/doc/inconsistencies https://github.com/facebook/hiphop-php/raw/master/doc/incons... and https://github.com/facebook/hiphop-php/raw/master/doc/inconsistencies.hphpi https://github.com/facebook/hiphop-php/raw/master/doc/incons... for a list of other inconsistencies between PHP and Hiphop.
- jarjar500 15y agois it easy to add an extension to hiphop? i.e mongo.so
- patrickgzill 15y agoI am curious if you have looked at Quercus, quercus.caucho.com as well? This is PHP compiled/interpreted to JVM.
- willemst 15y agoWe did not really consider it, as we have few experienced Java developers and had no need to make Java and PHP code work together. The Hiphop project started of because one engineer thought it was "really cool" and when he was able to produce impressive benchmarks, we put some more company effort into it.
- toumhi 15y agohe Willem, you still work there? First time I see Hyves on first page at HN. I didn't even know they were writing a blog on product development. How's it working? Are you writing articles alone, or are several guys writing on what they are working on? Very good idea in any case. Anyways, good luck with the fight against Facebook ;-) BTW, if you don't recognize me, I was the only frenchman working there at the time...