The first time I paste this little test for loop in PHP interactive shell mode (php -a from the command line), it runs perfectly.
for($weekday == 0; $weekday<7; $weekday++) { echo $weekday; }
Then I try pasting it and running it again a few times, it never returns any output. Why does it work the first time and do nothing after that?
Output:
And php -v returns PHP 7.1.1 (cli) (built: Jan 23 2017 15:09:57) ( NTS )
UPDATE: yes, I am stupid and used the comparison operator instead of the assignment operator. Dur. :-) But still, my original question is valid: WITH the comparison operator (as seen above), even though it is not exactly doing what I want it to do, why does it only execute once?
