Skip to content

Instantly share code, notes, and snippets.

View sebastianbergmann's full-sized avatar

Sebastian Bergmann sebastianbergmann

View GitHub Profile
<?php declare(strict_types=1);
function mb_sprintf($format, ...$args): string
{
$params = $args;
return sprintf(
preg_replace_callback(
'/(?<=%|%-)\d+(?=s)/',
static function ($length) use (&$params) {
$value = array_shift($params);
vendor/bin/paraunit run --testsuite unit,integration

PARAUNIT v.2.2.3
by Francesco Panina, Alessandro Lai & Shark Dev Team @ Facile.it
.....................................................................W..SW    74
W.........................................................................   148
..........................................................................   222
..........................................................................   296
..........................................................................   370

$argon2id$v=19$m=512,t=256,p=1$aawVElmKZ8yjJLf/IeJ/tg$2HDOj9i6fbatt7iQq1SrGKYClP3+qEXNi6U8d/49v78

<?php declare(strict_types=1);
error_reporting(-1);
ini_set('memory_limit', -1);
require __DIR__ . '/vendor/autoload.php';
use PhpParser\Node;
use PhpParser\Node\Expr\ConstFetch;
use PhpParser\Node\NullableType;
use PhpParser\Node\Param;
@sebastianbergmann
sebastianbergmann / 1-dump-bytecode
Last active March 23, 2024 09:21
Finding optimized-away bytecode
```
$ php -d opcache.enable=1 \
-d opcache.enable_cli=1 \
-d opcache.optimization_level=-1 \
-d opcache.opt_debug_level=0x10000 \
Runtime.php \
> /tmp/2-before-optimization 2>&1
```
```
$ php -d opcache.enable=1 \
@sebastianbergmann
sebastianbergmann / errors.md
Last active April 2, 2024 15:39
Mutation Testing for PHPUnit's own test suite