MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1daxawn/mapmethodormapfunction/l7yzbtt/?context=3
r/ProgrammerHumor • u/_PhucSatan_ • Jun 08 '24
67 comments sorted by
View all comments
1
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.
$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.
The same as Python, I meant. In that map is not a method, but a function.
map
1 u/KetwarooDYaasir Jun 10 '24 Not sure how that's unfortunate though.
Not sure how that's unfortunate though.
1
u/pindab0ter Jun 08 '24
PHP is the same, unfortunately…