Skip to content

Instantly share code, notes, and snippets.

@zackdouglas
Created February 23, 2011 01:53
Show Gist options
  • Save zackdouglas/839832 to your computer and use it in GitHub Desktop.
Save zackdouglas/839832 to your computer and use it in GitHub Desktop.
A rudimentary implementation of Ruby's tap(), generally useful for basic debugging.
/*
* To be used with
* <https://github.com/wellspringworldwide/PHP-ClassMixer>
*/
abstract class Tapable_Mixin {
public function tap($var_of_this, $eval) {
$$var_of_this = $this;
eval($eval);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment