I have array:
array(
0 => new SomeClass(1),
1 => new SomeClass(2),
2 => new SomeClass(3),
)
How can I use array map to call method (non-static) of SomeClass class for each item in my array?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There’s a more readable way than
array_maporarray_walk:but if you really want
array_map: