Created
October 11, 2015 22:28
-
-
Save KarelWintersky/8be37bbe8c797ded31c1 to your computer and use it in GitHub Desktop.
KW: Core functions
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 | |
/** | |
* Эквивалент isset( array[ key ] ) ? array[ key ] : default ; | |
* at PHP 7 useless, z = a ?? b; | |
* @param $array | |
* @param $key | |
* @param $default | |
*/ | |
function at($array, $key, $default) | |
{ | |
return isset($array[$key]) ? $array[$key] : $default; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment