Tag Archives: hack

Attributes in Hack

First there where PHP annotations

The introduction of PHP style annotation by (mis)using comments always felt like a bad idea for me. Maybe because I think a comment cannot have any meaning beside some meaningful information for a developer or a documenting system that parses the comments to extract the information. But other than it should be possible to remove all comments without changing the behaviour of a progam.
Continue reading Attributes in Hack

Hacking PHP

Facebook has launched the programming language HACK as neither a subset or superset of PHP but more a dialect. It adds typing, generics, lambdas and some more features to PHP.
In this blog I will show how some trivial PHP can be translated to HACK and some things I encountered while trying it out.

From PHP…

I start with a simple pure PHP5 class with a constructor and one method that echos the current variable $a. Nothing extraordinary but I want to show what have to be done to convert this code into a hack file.
Continue reading Hacking PHP