Last active
August 13, 2016 18:46
-
-
Save Krzysiu/10a204449e774cc14d78 to your computer and use it in GitHub Desktop.
PHP equivalent for DOS/Batch "REM" command, for Batch fanatics
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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){} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.