Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Very nice. I'm surprised, though, that they didn't go the OOP route, since they're transitioning a lot of other core procedural functions to objects. Even if it would be a super-simple class interface (almost to the point of not being strictly necessary), it would at least be consistent with the general drift of next-gen PHP.


I wanted to go down the OOP route initially. Then I decided against it for a number of reasons. Here's a breakdown of that reasoning... http://www.reddit.com/r/PHP/comments/zrprk/the_new_secure_pa...

Additionally, the general drift hasn't been towards OOP within PHP. Some OOP libraries are being added, but the core remains largely procedural (and doesn't appear to be shifting significantly yet). It's taking the (very logical IMHO) route of "Does this make sense to be OOP". If the answer is yes, then it goes in as a class structure. If not, it goes in procedurally.

I did not feel it made sense to make this a class, and as such I did not...


I think the PHP's standard library is as inconsistent as the next guy, but I kind of appreciate there just being a function when just a function is needed.

i.e. Python's standard library provides objects where appropriate, but often they will just put functions directly into modules for simplicity.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: