Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:93772 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 84859 invoked from network); 4 Jun 2016 17:09:11 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Jun 2016 17:09:11 -0000 Authentication-Results: pb1.pair.com header.from=rasmus@mindplay.dk; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=rasmus@mindplay.dk; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain mindplay.dk from 209.85.213.42 cause and error) X-PHP-List-Original-Sender: rasmus@mindplay.dk X-Host-Fingerprint: 209.85.213.42 mail-vk0-f42.google.com Received: from [209.85.213.42] ([209.85.213.42:36227] helo=mail-vk0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F0/C7-25194-53B03575 for ; Sat, 04 Jun 2016 13:09:10 -0400 Received: by mail-vk0-f42.google.com with SMTP id a6so152569033vkg.3 for ; Sat, 04 Jun 2016 10:09:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mindplay-dk.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=7gdVj+Txlep+dK2zkCSPguEe82NUVEY/w7TtlkceuEA=; b=GBdSs8uSniM/KiapneWesBFdoQoRv7SYcov9ccfWQi5USgO+fmPnclQ+1Dv8lZRGQY FCbdkGkVy3kQhseeh6CzHvkBlvETu2fpogUb86HmtW5uVJl++bst1dz7gGk0GFNv/vcC wdXQCWHtr4SN8ZCpCBxuSwZvf1KNDIeK05vEM4n/AfunNN5XAxp4DYH9r01Vlm/E/uP9 U8bApXmNPAM/YJAW1zzqpPXbeP5kCnr5xCdusU4atq7nYK7GSe+mig1AJjm+6010hTtx exD8Ne/3v/R0vkHgWWJpBJJuo6jBCo8d62VkHt6IfJ7aTSSB5cdnn2BaTU4mdmCSrIvO xejw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=7gdVj+Txlep+dK2zkCSPguEe82NUVEY/w7TtlkceuEA=; b=RdjAZJHJf8k2V5g352r2rSRhIl2nyal7WezOA1+wT3DWUuOKySmGgbd28OlSwVUSDk QWCP42YZ5hyDkrqeCkSSpmtZYuSdIxBiBW5EZD1bUuVOuG5WBlgHxLzrDmEh7jfCa6e3 lrc1M6Y5cZyrlu7ImzdzqP6Am/h+19OsJ+yRCEC07Y0VJQUxjS8GoHHDqdgbGtvfaouY skuc59EvhTzEZz+0lVudC+nTaM95q+zEWhRzODXx8UvNW3zxNtKxZEnm6fON/gCAhn0p QWo5aYnGWJHzZ/fPlZvyyBUV7Fgv4HNuzt+jROpDLy+yazV3AoLiXGcNW43L30Ziho9m GAtw== X-Gm-Message-State: ALyK8tKpaFKdDnTj989Ayo8EYO+QGIcH7tJ6gai6D5wSNNnA0nLAnFIscCpUzWOET8HK3skbXLty+PE0Kl6BZg== X-Received: by 10.31.55.134 with SMTP id e128mr3749755vka.57.1465060146689; Sat, 04 Jun 2016 10:09:06 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.76.200 with HTTP; Sat, 4 Jun 2016 10:09:06 -0700 (PDT) In-Reply-To: References: Date: Sat, 4 Jun 2016 19:09:06 +0200 Message-ID: To: PHP internals Content-Type: multipart/alternative; boundary=001a114475729e674f053476e511 Subject: Re: [PHP-DEV] [RFC DISCUSSION] typeof From: rasmus@mindplay.dk (Rasmus Schultz) --001a114475729e674f053476e511 Content-Type: text/plain; charset=UTF-8 Hi Richard, I can't review the implementation, but the RFC looks good - great initiative! The only thing I would comment on, is the idea of packing essentially two different functions into one - by default, the return value is a machine-friendly type-name, but the $extended argument turns it into a different function altogether, producing a human-readable type-description. It seems like you have two functions in one, and I personally would prefer having two functions. Other than that, this looks like a nice replacement for e.g. this lengthy switch-statement: https://github.com/mindplay-dk/readable/blob/master/src/readable.php#L30 Incidentally, this library creates "more readable" representations of e.g. closures, displaying filename and line number, which would be another nice-to-have, and another good reason to separate the human-readable function from the machine-friendly function. (I wrote this library mostly to create readable representations of e.g. invalid arguments so I can throw exceptions with more helpful messages - it would be great if that was no longer necessary.) On Sat, Jun 4, 2016 at 2:12 PM, Fleshgrinder wrote: > Hi all! > > I prepared my first contribution to internals: > > https://github.com/php/php-src/pull/1932 > > I would like to discuss the proposed new function here. I directly went > on and implemented it for the learning experience. I also prepared the > RFC, but as a Gist because I do not have Karma yet: > > https://gist.github.com/Fleshgrinder/6942daaae32372876e5219998e5e418c > > There are a few open issues (see Gist) that require discussion and of > course a code review of the pull request. > > -- > Richard "Fleshgrinder" Fussenegger > > --001a114475729e674f053476e511--