Arrow functions are kewl too
$b = 2; $f = fn($a) => $a + $b; $f(1); // 3
Enums are kewl too (PHP8.1)
Fibers are kewl too (PHP8.1) <= BIG game changer here!
Array destructuring in loops are awesome too:
$a = [[1,2,3],[4,5,6]]; foreach ($a as [$b, $c, $d]) { var_dump($b, $c, $d); }
Iterators & generators are awesome in PHP
function get_php_files(...$paths): Generator { foreach ($paths as $path) { if (is_file($path)) { yield new SplFileInfo($path); continue; } $it = new RecursiveDirectoryIterator($path); $it = new RecursiveIteratorIterator($it); $it = new RegexIterator($it, '/\.php$/', RegexIterator::MATCH); yield from $it; } }
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Arrow functions are kewl too
Enums are kewl too (PHP8.1)
Fibers are kewl too (PHP8.1) <= BIG game changer here!
Array destructuring in loops are awesome too:
Iterators & generators are awesome in PHP