for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Part of SplTypes package.
*
* (c) Adrien Loyant <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Ducks\Component\SplTypes\Tests\benchmark;
use Ducks\Component\SplTypes\SplInt as DuckInt;
class SplIntBench
{
* @Revs(1000)
* @Iterations(5)
* @return void
public function benchCreateZero(): void
new DuckInt();
}
public function benchCreateRand(): void
new DuckInt(mt_rand());
public function benchCreateMin(): void
new DuckInt(PHP_INT_MIN);
public function benchCreateMax(): void
new DuckInt(PHP_INT_MAX);
* @psalm-suppress UnsupportedReferenceUsage
public function benchMath(): void
$instance = new DuckInt(10);
$value = &$instance();
$value++;
$result = $value;
unset($result);