How to declare an array (php) like declaring an array in c++?

Ihsan

New member
Hi, I want to know whether PHP can do things like c++.

In c++ we can declare an array, and then assign the value later on if we need it.
eg:

int test[10];
....
....
test[0] = 40;
test[1] = 5;

Can we do this in php?

Because from most example I have seen, they declare the value inside array directly at the time array is being declared.
eg: $test = array(1, 2, 3);
 
Back
Top