PHP Array Functions: 8 Open-Source Laravel Examples

preview_player
Показать описание
Many Laravel developers are familiar with Collection methods, but good old PHP array functions are also a massive help.

Links mentioned in the video:

- - - - -
Support the channel by checking out my products:

- - - - -
Other places to follow:
Рекомендации по теме
Комментарии
Автор

If you are ever going to use the standard array methods, please use named parameters. It's annoying as hell how heap & needle or array & callback are in random order depending on the mood

spicynoodle
Автор

Thanks for the tutorial, your video really influence me how to write laravel code.
Im now start learning laravel nova, and i hope u can make tutorial videos for it too..

TheMYCHANEL
Автор

3:19 so it's always better using the Laravel built-in methods instead of core PHP (when available) but what about performance?

btw I like your sweater, it looks so cozy.

ricko
Автор

I agree with the importance of considering php functions directly. What bothers me in this video is a couple of bad coding examples. Especially the construct at 1:00 would be rejected from my quality checks if one of my programmers would push it. More than two expressions in a statement are considered to be bad, i.e. hardly comprehensible. It doesn't hurt to use more lines while it's bad to have long lies (>100). Here we see "dereferencing object" inside of "?:" inside of "array_filter" inside of "array_merge", very bad!

But I also want to point out that your daily lessons are usually very good!

fordprefect
Автор

Thank you for awesome tutorials. Waiting eagerly for some discount in subscriptions. 😊

kaisertushar
Автор

from extend or components which is better to use

kill
Автор

is there a difference between array_push(arr, value) and arr[] = value ?

soniablanche
Автор

Please don't use array_push($array, 'something'), use $array[] = 'something';. It should be faster and easier to read.
Also, I suggest using [...$array, ...$array2] instead of array_merge($array, $array2) - as it is faster, and, to me, easier to read and understand what the result is (note that string keys aren't added in older PHP versions).

IvanJelenić-ld
visit shbcf.ru