basic async-interop support; generator consumer missing
[m6w6/seekat] / lib / functions.php
1 <?php
2
3 namespace seekat;
4
5 /**
6 * Generate a human readable represenation of a variable
7 * @param mixed $arg
8 * @param bool $export whether to var_export the $arg
9 * @return string
10 */
11 function typeof($arg, $export = false) {
12 $type = (is_object($arg)
13 ? "instance of ".get_class($arg)
14 : gettype($arg)
15 );
16 if ($export) {
17 $type .= ": ".var_export($arg, true);
18 }
19 return $type;
20 }
21