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
import Reader from './Reader'; | |
import Target from './Target'; | |
/** | |
* This is default annotation property for automatic type casting: | |
* <code> | |
* @Annotation({ some: any }) | |
* // => will be casts "as is" {some: any} | |
* | |
* @Annotation("any") |
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 | |
declare(strict_types=1); | |
interface DecoratorInterface | |
{ | |
public static function handle(\Reflector $context, self $instance): void; | |
} |
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 | |
/** | |
* Exec "composer require railt/lexer ~1.2" | |
*/ | |
declare(strict_types=1); | |
namespace Example; | |
use Railt\Io\Readable; | |
use Railt\Lexer\Definition\TokenDefinition; |
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 | |
declare(strict_types=1); | |
namespace Serafim\MemProf\Zend; | |
use FFI\Contracts\Preprocessor\Exception\DirectiveDefinitionExceptionInterface; | |
use FFI\Contracts\Preprocessor\Exception\PreprocessorExceptionInterface; | |
use FFI\Contracts\Preprocessor\PreprocessorInterface; | |
use FFI\Preprocessor\Preprocessor; |
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 | |
namespace app\support\lib; | |
class Rect | |
{ | |
protected $left; | |
protected $top; | |
protected $width; | |
protected $height; |
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 | |
/** | |
* @template TArgStart | |
* @template TArgResume | |
* @template TArgReturn | |
* @template TArgSuspend | |
* | |
* @param \Fiber<TArgStart, TArgResume, TArgReturn, TArgSuspend> $fiber | |
* @param TArgStart ...$args | |
* @return \Generator<array-key, TArgResume, TArgReturn, TArgSuspend> |
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
benchInt8 | |
+-----------+------+---------+---------+ | |
| benchmark | set | mode | rstdev | | |
+-----------+------+---------+---------+ | |
| PackBench | raw | 0.972μs | ±22.36% | | |
| PackBench | pack | 1.336μs | ±25.69% | | |
+-----------+------+---------+---------+ | |
benchUInt8 | |
+-----------+------+---------+---------+ |
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 | |
namespace Bench; | |
use PhpBench\Attributes\BeforeMethods; | |
use PhpBench\Attributes\Iterations; | |
use PhpBench\Attributes\Revs; | |
use PhpBench\Attributes\Warmup; | |
#[Revs(100000), Warmup(2), Iterations(5)] |
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 | |
$variable = 23; | |
[$query, $params] = sql(fn() => <<<SQL | |
SELECT * FROM users WHERE id = ${yield $variable} OR id = ${yield 42} | |
SQL); | |
var_dump($query, $params); | |
// |
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 | |
class Example | |
{ | |
public function __construct( | |
public ?string $value = null, | |
) { | |
} | |
} | |
/** @var Example $object */ |
NewerOlder