Skip to content

Information

Faster PHP callbacks with a struct

Callbacks are everywhere in PHP: array_filter, usort, XML parser handlers, session handlers, WordPress hooks, closures passed around in every modern framework. On .NET, those calls go through the PeachPie runtime's IPhpCallable.Invoke. Thanks to a great contribution from @arontsang, that hot path just got leaner. Let's take a look at what changed and why it matters.

But Why?

Almost every post, article or thread on Reddit about PeachPie is inevitably met with someone posting the famed Ryan Reynolds GIF asking “but why?”, so instead of explaining each time, we decided to put our entire motivation behind this project on paper so that we can link to it.