Skip to content
View bench1.php
<?php
class Foo {
public function __construct($i)
{
$this->bar = $i;
}
}
$start = microtime(true);
$count = 1000000;
View repo.php
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;
View interpreter.php
<?php
$stack = [];
$labels = [];
$pointer = 0;
$instructions = [];
/**
* @param $stack
* @param $instructions
View README.md

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
View array-map-break-yield.php
<?php
class BreakOut extends Exception {}
function mapGenerator(array $arr, $callback)
{
$ret = [];
foreach ($arr as $val) {
try {
yield $callback($val);
View variadics.php
<?php
class Bar{}
$bars = [new Bar, new Bar, new Bar];
$ints = [1, 2, 3];
// without variadics
// lots of manual type checking
function oldFoo($bars)
{
View monolog-setup.php
<?php
$logger = new Logger('my logger');
// log DEBUG messages to file when there's at least a NOTICE
$fileHandler = new RotatingFileHandler(ABSPATH . '../logs/log.log', 0, Logger::DEBUG, true, 0777);
$fingersCrossedHandler = new FingersCrossedHandler($fileHandler, Logger::NOTICE, 1000);
$logger->pushHandler($fingersCrossedHandler);
View monolog-setup.php
<?php
$handler = new RotatingFileHandler(ABSPATH . '../logs/log.log', 0, Logger::DEBUG, true, 0777);
try {
$record = array(
'message' => (string) "Write test",
'context' => null,
'level' => Logger::DEBUG,
'level_name' => 'DEBUG',
View ssltest.py
#!/usr/bin/python
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford (jspenguin@jspenguin.org)
# The author disclaims copyright to this source code.
import sys
import struct
import socket
import time
import select
View ssltest.py
#!/usr/bin/python
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford (jspenguin@jspenguin.org)
# The author disclaims copyright to this source code.
import sys
import struct
import socket
import time
import select
Something went wrong with that request. Please try again.