Skip to content

Question about strict_types #35

Answered by mario-deluna
Yogarine asked this question in Q&A
Discussion options

You must be logged in to vote

Good point. If anything, the strict_types directive could potentially even shave off a few microseconds, as from my understanding, the Zend engine would not need to perform potential implicit casts (though I haven't checked the source to back up that claim).

To be completely honest, I'm not too happy that PHP does type checking at runtime, but I understand why they had to take that route.

When it comes to performance, there are few "micro-optimizations" that actually matter, but it mostly comes down to the following:

  • Use the right data structures for your problem.
    Always try to reduce computational complexity. For example, if collision detection is your bottleneck, use an octree, etc.
  • Im…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Yogarine
Comment options

Answer selected by Yogarine
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants