Home > Software engineering >  What is the variable's format in the return value?
What is the variable's format in the return value?

Time:05-03

I am a new learner in php. I found that there is a code:

if($x < time()){
     return [false,'error'];
}

The logic or variable is not matter, but I don't understand how [false,'error'] works. Is it a boolean or array or ..... ?

CodePudding user response:

It's an array. It has two elements of different two types. The first element type is boolean. The second element is a string.

Arrays can have elements of different types in PHP.

  • Related