Skip to content

Instantly share code, notes, and snippets.

Avatar

Joost Koehoorn JoostK

View GitHub Profile
@JoostK
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" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>comment</key>
<string>TODO:
• 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>
<key>fileTypes</key>
<array>
@JoostK
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
{
CG(active_op_array)->last--;
zend_do_if_end(TSRMLS_C);
- if (last_additional_catch->u.op.opline_num == -1) {
+ if (!last_additional_catch || last_additional_catch->u.op.opline_num == -1) {
@JoostK
JoostK / KVCMethodsGenerator.php
Created Jul 24, 2010
Generates KVC compliant property accessors
View KVCMethodsGenerator.php
<?php
define('_OBJC_CLASS', 'ClassName');
define('_OBJC_PROPERTY', 'propertyName');
class KVCMethodsGenerator {
private $_class;
private $_propertyName;
private $_ivar;
private $_ucfirstPropertyName;