Skip to content

Instantly share code, notes, and snippets.

@mncaudill
Created December 21, 2010 07:14
Show Gist options
  • Save mncaudill/749610 to your computer and use it in GitHub Desktop.
Save mncaudill/749610 to your computer and use it in GitHub Desktop.
Another quine. This one is a PHP program that prints a JavaScript program (I ran mine with node) that when the JS program is ran, it prints out the original PHP program.
<?php
$php="112,114,105,110,116,32,34,112,104,112,61,91,36,112,104,112,93,59,115,116,114,105,110,103,61,39,39,59,99,111,110,115,111,108,101,46,108,111,103,40,39,60,63,112,104,112,39,41,59,99,111,110,115,111,108,101,46,108,111,103,40,39,39,41,59,102,111,114,40,105,61,48,59,105,60,112,104,112,46,108,101,110,103,116,104,59,105,43,43,41,123,115,116,114,105,110,103,43,61,112,104,112,91,105,93,43,39,44,39,59,125,99,111,110,115,111,108,101,46,108,111,103,40,39,92,36,112,104,112,61,92,34,39,43,115,116,114,105,110,103,43,39,92,34,59,39,41,59,99,111,110,115,111,108,101,46,108,111,103,40,39,39,41,59,115,116,114,105,110,103,61,39,39,59,102,111,114,40,105,61,48,59,105,60,112,104,112,46,108,101,110,103,116,104,59,105,43,43,41,123,115,116,114,105,110,103,43,61,83,116,114,105,110,103,46,102,114,111,109,67,104,97,114,67,111,100,101,40,112,104,112,91,105,93,41,59,125,99,111,110,115,111,108,101,46,108,111,103,40,115,116,114,105,110,103,41,59,34,59,";
print "php=[$php];string='';console.log('<?php');console.log('');for(i=0;i<php.length;i++){string+=php[i]+',';}console.log('\$php=\"'+string+'\";');console.log('');string='';for(i=0;i<php.length;i++){string+=String.fromCharCode(php[i]);}console.log(string);";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment