Skip to content

Instantly share code, notes, and snippets.

View yields's full-sized avatar
:octocat:
☕ 💻

Amir Abushareb yields

:octocat:
☕ 💻
View GitHub Profile
<?php
class Context {
var $foo = 'Hello, World';
}
class Func {
function fn (callable $fn) {
$fn = $fn->bindto(new Context);
$fn();
<?php
class Context {
var $foo = 'Hello, World';
}
function contextbind ($cb) {
$cb = Closure::bind($cb, new Context);
$cb();
};
function describe () {}
describe('Request', function ($it) {
describe('Request#path', function ($it) {
$it('should equal `/`', function () {
return (new Request)->path;
})->should->equal('/');
<?php
function describe () {}
describe('Request', [
'it foo bar' => function () {
}
class Context {
var $foo = 'Hello, World';
}
function contextbind(&$cb) {
$cb = $cb->bindTo(new Context);
$cb();
}
<?php
class Context {
var $foo = 'Hello, World';
}
function contextbind(&$cb) {
$cb = $cb->bindTo(new Context);
$cb();
}
<?php
class Context {
var $foo = 'Hello, World';
}
function contextbind(&$cb) {
$cb->bindTo(new Context);
}
class Context {
var $foo = 'Hello, World';
}
function contextbind (&$cb) {
$cb = $cb->bindTo(new Context());
}
contextbind(function () {
echo $this->foo;
export PATH=/Applications/MAMP/bin/php/php5.3.6/bin:/usr/local/bin:/usr/local/sbin:/bin:/usr/sbin:/sbin:/usr/bin:/usr/X11/bin
export PATH=/usr/local/bin:/usr/local/sbin:/bin:/usr/sbin:/sbin:/usr/bin:/usr/X11/bin