Re: [PHP-DEV] optionally return class name from gettype

2016-09-05 Thread Timothy Younger
resource (closed)": https://github.com/php/php-src/blob/master/ext/standard/type.c#L71 although, this could break consumer code. e.g. gettype($obj) === "object". maybe this option is not so good. On Mon, Sep 5, 2016 at 12:02 AM, Timothy Younger wrote: > thank you all for your feedb

Re: [PHP-DEV] optionally return class name from gettype

2016-09-05 Thread Timothy Younger
thank you all for your feedback. it seems this thread is split between an optional param and a new function, so i created a new function called var_type for comparison. commit: https://github.com/abacaphiliac/php-src/commit/eca6f77bf2744c79671d1dfbb641b753503d4a1a build: https://travis-ci.org/aba

[PHP-DEV] optionally return class name from gettype

2016-07-29 Thread Timothy Younger
hi Internals Team, i find myself writing this line frequently in projects: is_object($value) ? get_class($value) : gettype($value); it seems i'm not the only one: https://github.com/search?l=php&q=get_class+gettype&ref=searchresults&type=Code&utf8=%E2%9C%93 although it is small, it amounts to