Improved retry function for igorw/retry, as proposed by @acleon.
Benefits:
- Appears to use fewer opcodes (This is the 1st time I've used VLD, I could be wrong)
- Doesn't use goto
Improved retry function for igorw/retry, as proposed by @acleon.
Benefits:
<?php | |
$stack = []; | |
$labels = []; | |
$pointer = 0; | |
$instructions = []; | |
/** | |
* @param $stack | |
* @param $instructions |
class Repo | |
{ | |
public function fetchByName($name) | |
{ | |
$entity = $this->em->fetch(['name' => $name]); | |
if (!$entity) { | |
$entity = new NullEntity($name); | |
} | |
$this->dispatcher->dispatch(new EntityRetrievedEvent($entity)); | |
return $entity; |
<?php | |
class Foo { | |
public function __construct($i) | |
{ | |
$this->bar = $i; | |
} | |
} | |
$start = microtime(true); | |
$count = 1000000; |
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
#!/bin/bash | |
# stolen from template file | |
if git rev-parse --verify HEAD > /dev/null | |
then | |
against=HEAD | |
else | |
# Initial commit: diff against an empty tree object | |
against=4b825dc642cb6eb9a060e54bf8d69288fbee4904 |