Skip to content

Instantly share code, notes, and snippets.


Joost Koehoorn JoostK

View GitHub Profile
JoostK / PHP.tmLanguage
Last active Dec 19, 2015
Patched for namespace support in classnames. On OS X, go to Sublime menu -> Preferences -> Browse Packages. Then overwrite `PHP/PHP.tmLanguage` with the contents of this gist.
View PHP.tmLanguage
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">
• Try to improve parameters list syntax – scope numbers, ‘=’, ‘,’ and possibly be intelligent about entity ordering
• Is meta.function-call the correct scope? I've added it to my theme but by default it's not highlighted</string>
JoostK / php-anonymous-catch.diff
Created Jun 24, 2013
PHP Anonymous catches patch
View php-anonymous-catch.diff
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index faef3a9..ce675b1 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -2848,7 +2848,7 @@ void zend_do_mark_last_catch(const znode *first_catch, const znode *last_additio
- if (last_additional_catch->u.op.opline_num == -1) {
+ if (!last_additional_catch || last_additional_catch->u.op.opline_num == -1) {
JoostK / KVCMethodsGenerator.php
Created Jul 24, 2010
Generates KVC compliant property accessors
View KVCMethodsGenerator.php
define('_OBJC_CLASS', 'ClassName');
define('_OBJC_PROPERTY', 'propertyName');
class KVCMethodsGenerator {
private $_class;
private $_propertyName;
private $_ivar;
private $_ucfirstPropertyName;