Nicolas Grekas - nicolas.grekas, gmail.com
17 juin 2011 - Dernière mise à jour le 3 sept. 2011
Ce gist n'est plus mis à jour. Voir maintenant :
- Version française : https://github.com/nicolas-grekas/Patchwork-Doc/blob/master/Advanced-HTTP-fr.md
<?php | |
// composer require patchwork/dumper '1.0.*' | |
require __DIR__ . '/vendor/autoload.php'; | |
set_debug_handler(function ($var) { | |
$c = new Patchwork\Dumper\Collector\PhpCollector(); | |
$data = $c->collect($var); | |
$data->dump(new Patchwork\Dumper\CliDumper()); | |
}); |
<?php | |
$len = 1000000; | |
$a = range(1, $len); | |
$f = SplFixedArray::fromArray($a); | |
$s = microtime(1); | |
$i = $len; |
<?php | |
$foo = function (): foo { | |
return new foo(); | |
}; | |
$foo instanceof foo; // => true | |
$foo->toto = 123; // $foo() is evaluated and is swapped to its return value |
Nicolas Grekas - nicolas.grekas, gmail.com
17 juin 2011 - Dernière mise à jour le 3 sept. 2011
Ce gist n'est plus mis à jour. Voir maintenant :
<?php | |
if (isset($_GET['i'])) | |
{ | |
// Send a blank gzipped GIF to test browser capability to decode it | |
// See http://www.stevesouders.com/blog/2010/07/12/velocity-forcing-gzip-compression/ | |
header('Content-Type: image/gif'); | |
header('Content-Encoding: deflate'); | |
header('Pragma: no-cache'); |
{ | |
"name": "nicolas-grekas/debug-helpers", | |
"description": "Global Debug Helpers for PHP", | |
"require": { | |
"symfony/var-dumper": "2.8.*@dev" | |
}, | |
"authors": [ | |
{ | |
"name": "Nicolas Grekas", | |
"email": "p@tchwork.com" |
<?php | |
use Symfony\Component\VarDumper\Cloner\VarCloner; | |
use Symfony\Component\VarDumper\Dumper\CliDumper; | |
function dump($var) | |
{ | |
static $handler; | |
if (null === self::$handler) { |
git clone https://github.com/nicolas-grekas/Patchwork-PHP-Parser.git ppp | |
cd ppp | |
./bin/ppp t1.php #see below for t1.php (and t2.php, required by t1.php) |
#!/bin/bash | |
go_version=$1 | |
go_arch=linux-amd64 | |
export GOPATH="$HOME/go" | |
if [ ! -e $GOPATH ] | |
then | |
mkdir $GOPATH |