Skip to content

Instantly share code, notes, and snippets.

@sofish
Created November 1, 2012 08:58
Show Gist options
  • Save sofish/3992575 to your computer and use it in GitHub Desktop.
Save sofish/3992575 to your computer and use it in GitHub Desktop.
write a code snippet to print itself
// JS:
(function(){console.log('(' + arguments.callee.toString() + ')()')})();
// JS, recursion
~function (){
typeof i !== 'number' && (i = 0);
return (i++ < 3) &&
(fn = '~' + arguments.callee.toString() + '()') &&
(console.log(fn), eval(fn));
}();
@ryunhe
Copy link

ryunhe commented Nov 1, 2012

<?php $s='<?php $s="%s"; echo sprintf("\'".$s."\'", $s);?>'; echo sprintf("\'".$s."\'", $s);?> 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment