Following on from the recently released M language bindings for Python and Ruby, M/Gateway Developments has now updated an Open Source language binding for PHP. 'mg_php' will work with all InterSystems products and YottaDB. As with the other language bindings, there are two connectivity models to choose from: TCP based connectivity to either a local or remote database or high performance API-based connectivity to a local database, though the latter modus operandi may be more of an eccentric curiosity when operating within the context of a modern multithreaded web server. As you might have guessed, all these language bindings share the same connectivity library, so whatever new facility (or bug fix!) becomes available for one, becomes automatically available to all the others.
Those who have followed us over the years will know that we've long had a PHP solution for M (since 2002 in fact), but it's only recently that I've got around to releasing it as a bona fide Open Source solution.
PHP, as a language, is culturally very similar to M. In particular, developers will be quick to notice the similarities between global arrays in M and associative arrays in PHP. mg_php allows you to seamlessly project data between the two environments. And later versions of PHP contain embedded support for complex data types such as JSON.
The similarities with M don't end with the language. Just as industry pundits have been confidently predicting the demise of M for pretty much the duration of my (fairly long!) IT career, the same kind of folk have been saying the same about PHP for quite a while. Well, according to W3Techs, PHP is still used for 79% of public web sites for which the application development language is known, Admittedly, this is slightly down from a previous survey suggesting an over 80% share. Still, these findings suggest that PHP remains a force to be reckoned with. And the PHP Group haven't been resting on their laurels either. In addition to keeping pace with modern trends and data types, they have managed to achieve some impressive performance gains between PHP v5.6 and v7.4. Tests performed by Kinsta indicate a 3x performance improvement for some of their benchmarks.
All this being the case, we probably ought to have an M solution for the 'not-quite-deprecated' PHP environment - hence the release of this Open Source initiative. Maybe one day M databases will be as 'deprecated' as PHP ...
Chris.