Created
April 13, 2018 04:15
-
-
Save Majkl578/1793df5a1188faf1c81dffd90c1e77c0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
new class | |
{ | |
public function __construct() | |
{ | |
$s = microtime(true); | |
for ($i = 0; $i < 100000000; $i++) { | |
(function () {})(); | |
} | |
var_dump(microtime(true) - $s); // float(7.6048729419708) | |
$s = microtime(true); | |
for ($i = 0; $i < 100000000; $i++) { | |
(static function () {})(); | |
} | |
var_dump(microtime(true) - $s); // float(7.3303070068359) | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment