walkor / walkor/workerman

Use static anonymous functions

Open
#861 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
11.6k
Forks
2.2k
Avg merge
11h 30m
Merged PRs (30d)
3

Description

Will be good to change in all the code and examples.

And explain that's better to use static.

For performance and memory benefit.

> Anonymous functions when declared in the context of a class, the current class is automatically bound to it, making $this available inside of the function's scope. If this automatic binding of the current class is not wanted, then [static anonymous functions](https://www.php.net/manual/en/functions.anonymous.php#functions.anonymous-functions.static) may be used instead.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.