Back

Hey PHP Developers

Do you know that you can skip the initialisation expression inside a traditional for loop in PHP if the variable has already been initialised?

For example, the variable is passed as a parameter to the function using which you want to initialize the for loop.

Just a small syntactic but interesting behaviour to know about the language.

Here is an example code of what I am talking about.

image

1

222

  • No matching results...
  • Searching...

/ 1000