Skip to content

Instantly share code, notes, and snippets.

@DaveRandom
Created April 8, 2020 23:22
Show Gist options
  • Save DaveRandom/40750f26613fc384376595a1a44a49b9 to your computer and use it in GitHub Desktop.
Save DaveRandom/40750f26613fc384376595a1a44a49b9 to your computer and use it in GitHub Desktop.
Execute batch file as PHP script (one line shebang for PHP scripts on Windows)
@(<nul set /p=#! & type ^"%~f0^") | php -- %* & goto :eof
<?php declare(strict_types=1);
// script goes here
var_dump($argv);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment