Skip to content

Instantly share code, notes, and snippets.

@byk0t
Created February 6, 2014 12:52
Show Gist options
  • Save byk0t/8843590 to your computer and use it in GitHub Desktop.
Save byk0t/8843590 to your computer and use it in GitHub Desktop.
php analogue of python's `if __name__ == "__main__"`
#!/usr/bin/php
<?php
if( basename($argv[0]) == basename(__FILE__) ) {
echo "\n-----main------\n\n";
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment