Skip to content

Instantly share code, notes, and snippets.

View mzimhle's full-sized avatar

Cashmire mzimhle

View GitHub Profile
@krmgns
krmgns / each.php
Last active October 28, 2022 09:47
Polyfill for "each" function that was removed as of PHP/8
<?php
if (!function_exists('each')) {
function each(array &$array) {
$value = current($array);
$key = key($array);
if (is_null($key)) {
return false;
}