Created
July 9, 2023 06:50
-
-
Save lipemat/9b9ab5ed40df86da3915b572ff3141ae to your computer and use it in GitHub Desktop.
Example PHPBench PHP 8.1 errors
This file contains 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 | |
/** | |
* @notice This file must live in a "benchmarks" directory for this exmaple. | |
*/ | |
class Filemtime_VS_MD5_VS_Hash_File_Bench { | |
/** | |
* @Revs(1000) | |
* @Iterations(3) | |
*/ | |
public function bench_filetime() : void { | |
filemtime( __FILE__ ); | |
} | |
/** | |
* @Revs(1000) | |
* @Iterations(3) | |
*/ | |
public function bench_md4_file() : void { | |
hash_file( 'md4', __FILE__ ); | |
} | |
/** | |
* @Revs(1000) | |
* @Iterations(3) | |
*/ | |
public function bench_md5_file() : void { | |
md5_file( __FILE__ ); | |
} | |
/** | |
* @Revs(1000) | |
* @Iterations(3) | |
*/ | |
public function bench_fnv1a_file() : void { | |
hash_file( 'fnv1a64', __FILE__ ); | |
} | |
/** | |
* @Revs(1000) | |
* @Iterations(3) | |
*/ | |
public function bench_murmur_file() : void { | |
hash_file( 'murmur3f', __FILE__ ); | |
} | |
} |
This file contains 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
{ | |
"runner.php_disable_ini": true, | |
"runner.path": "benchmarks" | |
} |
This file contains 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 phpbench.phar run |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment