Is it possible to use an array without initializing it?

前端 未结 2 1467
深忆病人
深忆病人 2021-01-25 23:41

I have seen some code from Stack Overflow. It confused me a lot. I just don\'t know whether some part is missing or not.

The code is as follows:

$ch = cu         


        
2条回答
  •  囚心锁ツ
    2021-01-26 00:09

    In short, yes.

    PHP isn't (at the moment) that explicit about declaring data types when creating variables - unlike other languages, although I'm sure PHP are changing their ways.

    Although you can do this, it's advised (good practice) to declare the data type of the variable before assigning value(s) to it.

提交回复
热议问题