Is there a way in PHP for me to specify that an array will consist only of certain types of objects? -


for example suppose have car object , want array consist of cars. there syntax allows me this?

no. php not have strong typing.

the way can think of enforcing have cararray class has getters,setters,etc.. functions enforce parameters of class car.


Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -