Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Created by PhpStorm.
- * User: khoand
- * Date: 11/29/15
- * Time: 7:14 PM
- */
- class Shared
- {
- public static function key($array, $key, $default = null)
- {
- return isset($array[$key]) ? $array[$key] : $default;
- }
- public static function attribute($object, $key, $default = null)
- {
- return isset($object->$key) ? $object->$key : $default;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement