News for hackers. Stuff that matters.
Re:Making PHP Safer by psaintla on Friday January 31, 2014 @04:52PM (#7159407)
I'd really like to know why they chose to do this instead of trying to make spltypes and type hinting more robust. Annotations seem like an ugly way of doing this.
Re:Making PHP Safer by sentiental on Friday January 31, 2014 @05:02PM (#7159468)
One of the authors here. We didnt want to change the AST in a way that would be backwards incompatible with vanilla PHP. There is some luxury in being able to turn off this extension when needed. We also have a large enough existing codebase that switching to SPL types everywhere was a non-starter. Our goal here was partly to be able to use PHP's native types and still get some good coverage.

Phpdoc may not seem ideal, and it's not, but it has afforded some significant flexibility

Re:Making PHP Safer by psaintla on Saturday February 01, 2014 @12:42PM (#7162409)
Thank you for your response, that's good reasoning and I definitely see it works well for your use case. It just seems as if multiple companies are coming up with solutions to work around deficiencies in PHP which is causing fragmentation in the language. That's not going to stop me from using this extension in a new project I'm starting though. Are there any areas of this extension you'd like to see improved since I find the best way for me to understand an extension internally is to work on it.
Re:Making PHP Safer by wvenable on Friday January 31, 2014 @05:04PM (#7159478)
The reasons are right in the article: they didn't want to fork PHP and they didn't want a run-time performance hit.

It seems like an interesting solution to me.