Well, it will probably surprise you, but I don’t think one is necessarily better than another. There are some small differences, but for me none is so big that I can declare one as the winner. It depends on your specific needs, and the context of your current workflow with PHP apps. And I will explain in a minute why that is.
For me performance is one of the top criteria that I would use to choose one over another. All these libraries are written in PHP, and although I didn’t conduct an extensive test, I don’t think consider one faster than another. If you wrote a PHP module in C, to add some new API to PHP for remoting, then you could have something much faster. For example, AmFast (a remoting library for Python written in C) is up to 18x faster than PyAMF written in Python.
As the situation stands today, I don’t think we have a winner here. If someone performs a test and finds that I am wrong, please let me know!
Documentation and ease of use
Here, the alternatives are not so level. While implementing examples with each one of them, I must say AMFPHP was the easiest to use. The documentation is OK, since it has been around for some time you can find articles explaining how to use it; and it has a Services Browser, a Flex application that lets you test your PHP services. This can be very handy when you are debugging a project. There is a folder where you can drop your service and it will be automatically picked up, and a folder for your VOs. These two folders can be configured.
WebORB has good documentation too, and it comes with examples. There is also a Flex application that provides easy access to some quick start articles, a browser service, a code generator, and a way to configure the destinations. I didn’t find this code generator particularly helpful. For example, I expected to generate an ActionScript class out of the PHP model class, instead it generated a wrapper class for the remote object, and it tried to generate the ActionScript model. I say it tried to generate, because it generates a strange data model, which basically has a property for each method on your PHP remote class of Object type. It has a special folder where you have to add your services and VOs.
The next one is Zend AMF. It has decent documentation and is the newest on the market. The guy who developed it, actually is the same guy who created AMFPHP, so it must be good. However it doesn’t have a service browser, so it is harder to debug the PHP code compared to the previous two. But it has a big advantage: it is part of Zend Framework. So if you are already using Zend Framework, or you plan to use features from it, then this is the choice for you. You need to create a bootstrap file to start the AMF server, to add the services (either one by one, or by folder), and to set the correspondence between the ActionScript and PHP data model classes.
The last one is SabreAMF. The documentation is not so good and there are not so many articles, but if you know what remoting is, then you can find your way. It is little bit strange to use, as it doesn’t impose any particular structure. You have to create a boot strap file, where you configure the corresponding data model classes. And you need to create a callback function that will do the lookup for your service classes. Actually, if you change the callback function a little bit, you can even call your defined functions, not only object’s methods.
The smallest ones are SabreAMF and AMFPHP. These two just do remoting. Zend AMF is part of Zend Framework, an application framework for PHP (so you have a lot of functionality, and a lot of code). WebORB for PHP does remoting, plus messaging and data management. So again, there is more code in it.
It seems all four libraries are maintained, although two of them have companies behind them: Zend AMF with Zend Technologies, and WebORB for PHP with Midnight Coders. The other two have one smart developer behind them. The thing is that it doesn’t really matter who is behind it, because it is really easy to switch from one framework to another one. Thus, if in the future you find that your PHP library for remoting is no longer maintained, it is not the end of the world; you can switch to another one.
Mirror, mirror on the wall, who is the most beautiful of them all?
Instead of spending too much time deciding which one to choose, just play with it or look at an example and see for yourself which one you are in tune with. If you have some special needs, for example, if you are already using Zend Framework, or using another framework, then it is even easier to choose.
As I already said, even if you eventually find that you made the wrong choice, it is not the end of the world, you can switch to another one very easily.
Happy remoting, people!
PS. If you have a favorite, do you mind posting a comment to briefly explain why you chose it? Thanks!