Created
October 1, 2020 14:42
-
-
Save LarryBarker/48e184417b72eedcd5f55cca432de574 to your computer and use it in GitHub Desktop.
Determine the next item in an associative array
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$stages = $this->getStages(); // ['foo'=>'bar','bar'=>'foo'] | |
while (key($stages) !== $this->status) { | |
next($stages); // advance til there's a match | |
} | |
return next($stages); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment