4 ms·
Arr::get($data, 'more.complex.0'); is much nicer, I agree. I do think better languages do it better, for example in Elixir I can extract multiple elements out
by anko 6y ago
Arr::get($data, 'more.complex.0'); is much nicer, I agree.
I do think better languages do it better, for example in Elixir I can extract multiple elements out of an object at the same time.
object = %{nested: ["my value"], other: "some element"}
%{nested: [first | _], other: other} = object
first now equals "my value" and other now equals "some element".
PHP sucks because of the legacy it pulls with it that keeps it from being simple and elegant. It also fails pretty hard when you use it outside of it's niche, and a multi-purpose language > single purpose language.
- artificial 6y agoYeah, still just checking it out, getting an auth system working with oAuth in about 15 mins via Socialite was fun. I want to test out the Lambda deployment which seems sweet. I use Serverless for that ATM with JS and Python. Elixir pattern matching is fantastic and I miss being able to call functions by arity. I don't know which deployment process I prefer, yet. They all suck.