Skip to content

Instantly share code, notes, and snippets.

@thekid
thekid / tools.diff
Created May 20, 2014 08:35
XP Runners: Patch core for XP Runners "no-path-arg"
diff --git a/tools/class-main.php b/tools/class-main.php
index efd6f91..2fcede3 100755
--- a/tools/class-main.php
+++ b/tools/class-main.php
@@ -44,11 +44,9 @@ if (!include(__DIR__.DIRECTORY_SEPARATOR.'lang.base.php')) {
exit(0x3d);
}
-$home= getenv('HOME');
-list($use, $include)= explode(PATH_SEPARATOR.PATH_SEPARATOR, get_include_path());
@thekid
thekid / Query.class.php
Created July 25, 2014 18:06
Query class
<?php
use lang\Throwable;
use util\profiling\Timer;
use rdbms\DriverManager;
use rdbms\ResultSet;
use io\streams\Streams;
use io\streams\TextWriter;
/**
@thekid
thekid / pr-647.diff
Created August 16, 2014 16:05
git diff master catchable-fatals/methods-on-non-objects Zend/zend_vm_def.h
diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h
index 7749197..4309277 100644
--- a/Zend/zend_vm_def.h
+++ b/Zend/zend_vm_def.h
@@ -2213,11 +2213,48 @@ ZEND_VM_HANDLER(112, ZEND_INIT_METHOD_CALL, TMP|VAR|UNUSED|CV, CONST|TMP|VAR|CV)
object = GET_OP1_OBJ_ZVAL_PTR_DEREF(BP_VAR_R);
if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+ zend_uint nesting = 1;
+
@thekid
thekid / catchable-call-to-member-of-non-object.diff
Last active August 29, 2015 14:07
Patch for PHP PR #847 - Catchable "Call to a member function bar() on a non-object"
diff --git a/NEWS b/NEWS
index c348efe..2f8883b 100644
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,8 @@ PHP NEWS
. Update the MIME type list from the one shipped by Apache HTTPD. (Adam)
- Core:
+ . Implemented the RFC `Catchable "Call to a member function bar() on a
+ non-object"` (Timm)
@thekid
thekid / Test.class.php
Last active August 29, 2015 14:13
When / Then / Match expression DSL
<?php
use util\cmd\Console;
class One extends \lang\Object {
}
class Two extends \lang\Object {
@thekid
thekid / Test.class.php
Last active August 29, 2015 14:13
Brainstorming for sequence handling split based on element criteria
<?php
use util\data\Sequence;
class Types extends \lang\Enum {
public static $OPEN, $CLOSED;
}
class Wall extends \lang\Object {
private $name, $type;
@thekid
thekid / iteration-idea1.php
Last active August 29, 2015 14:18
Iteration trait with extensions
<?php
use util\data\Sequence;
use lang\Error;
trait Iteration {
public static $extensions= [];
public function __call($name, $args) {
if (isset(Iteration::$extensions[$name])) {
@thekid
thekid / keybase.md
Created April 22, 2015 15:36
keybase.md

Keybase proof

I hereby claim:

  • I am thekid on github.
  • I am thekid (https://keybase.io/thekid) on keybase.
  • I have a public key whose fingerprint is 68EE F23B A5EC 3F4B FB8A 6B27 3140 68E1 9B60 6B23

To claim this, I am signing this object:

@thekid
thekid / Convert.class.php
Last active September 26, 2015 20:52
Convert PHP syntax
<?php
use io\collections\FileCollection;
use io\collections\iterate\FilteredIOCollectionIterator;
use io\collections\iterate\ExtensionEqualsFilter;
use util\cmd\Console;
use io\streams\Streams;
class Convert {
const IMPORTS = "<?=imports; ?>\n";
@thekid
thekid / Command.cs
Last active October 10, 2015 17:27
XP Subcommand / Options / Arguments parsing
using System;
using System.Collections.Generic;
interface Command
{
int Run(Dictionary<string, string> options, IList<string> arguments);
}