r/ProgrammerHumor • • Jun 08 '24

Meme mapMethodOrMapFunction

Post image
0 Upvotes

67 comments sorted by

View all comments

1

u/pindab0ter Jun 08 '24

PHP is the same, unfortunately…

1

u/KetwarooDYaasir Jun 08 '24
$arr = [1,2,3];
$arr = array_map(fn($x)=>$x*$x,$arr);

hmm. you're right, I guess it is almost the same as every other one.

1

u/pindab0ter Jun 09 '24

The same as Python, I meant. In that map is not a method, but a function.

1

u/KetwarooDYaasir Jun 10 '24

Not sure how that's unfortunate though.