I use higher-order methods like map/reduce/filter now, storing temporary results in variables when needed (although PHP's lack of const variables is a travesty). PHP's functional model of receiving data, transmuting it with the help of copy-on-write arrays, and returning it with a possible side effect stored in a database, all in an independent process, is one of the best around IMHO. It's too bad that legacy mistakes/features in the language and performance inefficiencies in operating system multiprocessing implementations (Windows, cough) obfuscate how powerful this model is.
Most/all of the complexity in debugging comes from mutation and side effects. Unfortunately nearly every language gets this wrong. Python has a huge emphasis on mutating variables rather than returning values that can be piped to the next function. Rust goes to great lengths with its borrow checker to allow mutation when copy-on-write would negate most of the need for that. I'd like to see a language and even an operating system that piped data around rather than mutating it in place, with an accepted cost of taking about twice as much memory to accomplish it. Then code could be mapped directly to spreadsheet form, and code execution could be mapped to diffs between state transitions to provide rewind functionality and debugging for free.
I would love to work on a paradigm like this if I had any spare money and time at all to do it. I've waited since the 90s for what I consider basic features, but sadly almost no language got this stuff right in the time since. Which leaves me with the unfortunate impression that probably 90% of the work we do in programming is a waste of time. Imagine if that wasted effort had gone towards solving foundational problems in programming for the benefit of all, instead of internet lottery winners just rolling their profits into their next venture.