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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Document</title> | |
</head> | |
<body> | |
<form action="/" id="form"> | |
<input type="text" fixed="abc" id="custom"> |
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 | |
#[attribute] | |
class Route | |
{ | |
public $method; | |
public $path; | |
public function __construct($method, $path) { |
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 | |
/** | |
* @var array[] | |
* @var string | |
* @var string | |
*/ | |
function csv($aCsv, $sDelimiter = ',', $sLineBreak = "\n") | |
{ | |
return implode($sLineBreak, array_map( |
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 | |
echo "Begin ...\n"; | |
for( $i = 0 ; $i < 10 ; $i++ ) | |
{ | |
echo $i . "\n"; | |
flush(); | |
sleep(1); | |
} | |
echo "End ...\n"; |
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 | |
declare(strict_types=1); | |
/** | |
* wrapper around the bcdec extension | |
* | |
* @see https://www.php.net/manual/en/book.bc.php | |
*/ | |
class Bcdec |
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 | |
/** | |
* clear overview of backtrace | |
* | |
* @return string | |
*/ | |
function backTrace($traces = null) | |
{ | |
$traces = $traces ?? debug_backtrace(); |
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 | |
class singleton | |
{ | |
/** | |
* protect the construct | |
*/ | |
protected function __construct() | |
{ | |
} |
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 | |
use Psr\Http\Message\RequestInterface; | |
use Psr\Http\Message\ResponseInterface; | |
use Psr\Log\LoggerInterface; | |
class LoggingMiddleware | |
{ | |
/** @var LoggerInterface */ | |
private $logger; |
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 | |
function test1($arr) | |
{ | |
$arr = array_fill(0, 10000, true); | |
$start = microtime(); | |
for ($i = 0; $i < count($arr); $i++) { | |
array_fill(0, 500, "abc"); | |
} |
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 | |
/** @see https://github.com/beberlei/assert */ | |
require __DIR__ . '/vendor/autoload.php'; | |
use Assert\Assertion as A; | |
$sLang = 'en'; |