Skip to content

Instantly share code, notes, and snippets.

@Krzysiu
Last active August 13, 2016 18:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Krzysiu/10a204449e774cc14d78 to your computer and use it in GitHub Desktop.
Save Krzysiu/10a204449e774cc14d78 to your computer and use it in GitHub Desktop.
PHP equivalent for DOS/Batch "REM" command, for Batch fanatics
/*
Batch (Dos/Windows) files haven't remark/comment suport in their syntax. The only
official way is to use "rem", which is actually a command. Coders who changed
their language from batch to PHP may feel unfair, cheated, sad, even suicidal.
Here it is - function that mimics REM from batch files. Because that function is
very complicated, probably there are a lot of bugs. Please note me if you'd find
any. I hope it will make your batch>php conversion much easier.
Usage:
rem([{mixed}$comment]);
* $comment - optional comment
Example:
rem('Bite my shiny metal batch');
rem();
rem('Empty comment above, just like grandma did in her batches!');
rem('Thank you, dear author of rem(), you've changed my way of life.');
*/
<?
function rem($comment = null){}
@Krzysiu
Copy link
Author

Krzysiu commented Aug 13, 2016

As it was said, the difficulty of coding such function caused bug, that I've just fixed. The comment doesn't have to be string and now it's optional, like original Batch command.

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