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 MyLib; | |
class Dir | |
{ | |
/** | |
* Returns all entries in the directory as RecursiveDirectoryIterator | |
* ディレクトリ内の全エントリーをRecursiveDirectoryIteratorで返す | |
* |
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 | |
require_once __DIR__ . '/../vendor/autoload.php'; | |
use HeadlessChromium\BrowserFactory; | |
use HeadlessChromium\Clip; | |
use HeadlessChromium\Dom\Dom; | |
use HeadlessChromium\Dom\Selector\CssSelector; | |
use HeadlessChromium\Page; | |
use headlessChromium\Utils; |
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 | |
function benchmark(string $name, Closure $callback) | |
{ | |
$start = microtime(true); | |
$callback(); | |
$time = microtime(true) - $start; | |
echo sprintf( | |
"%24s =>\tTime: %.6f sec.\n", | |
$name, |
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 | |
if (!function_exists('interface_exists')) { | |
die('PHP version too old'); | |
} | |
$throwables = listThrowableClasses(); | |
$throwablesPerParent = splitInParents($throwables); | |
printTree($throwablesPerParent); | |
if (count($throwablesPerParent) !== 0) { | |
die('ERROR!!!'); |