Hacker News new | past | comments | ask | show | jobs | submit login

> It is not much worse than using it in javascript.

It is worse because people are even less familiar with this in PHP. It's not idiomatic.

> I just tested it in PHP and it seems it is 20% faster in PHP compared to casting to int.

How rigorous was your testing? Which version of PHP were you using?

> It makes sense in javascript to that its faster than functions, but why it is faster than a cast in PHP?

It shouldn't be. It might save an allocation in older PHP versions, I'm not sure.




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: