Skip to content

build first class callables for hooks#9206

Open
live627 wants to merge 5 commits intoSimpleMachines:release-3.0from
live627:first-class-hooks
Open

build first class callables for hooks#9206
live627 wants to merge 5 commits intoSimpleMachines:release-3.0from
live627:first-class-hooks

Conversation

@live627
Copy link
Copy Markdown
Contributor

@live627 live627 commented May 4, 2026

This is the first of a series of pull requests that will convert string callables to first-class callables. Each branch will focus on a single related unit. For example, this one addresses hooks, while another one focuses on menus, and so on.

Fully backward compatible. I have compiled a script testing all the various callable types that I can think of:

https://github.com/live627/benchmark-tests/blob/main/callables.php

It’s quite interesting how the static class::method syntax lost the horse race. Any string method will be slower because it is internally converted to a callable, and the first-class syntax can be used directly:

https://github.com/live627/benchmark-tests/blob/main/callables.txt

@live627 live627 added the Hooks label May 4, 2026
Comment thread Sources/IntegrationHook.php Outdated
Co-authored-by: John Rayes <live627@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant