Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:95631 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 54614 invoked from network); 5 Sep 2016 07:02:40 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Sep 2016 07:02:40 -0000 Authentication-Results: pb1.pair.com header.from=abacaphiliac@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=abacaphiliac@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.48 as permitted sender) X-PHP-List-Original-Sender: abacaphiliac@gmail.com X-Host-Fingerprint: 209.85.214.48 mail-it0-f48.google.com Received: from [209.85.214.48] ([209.85.214.48:37049] helo=mail-it0-f48.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 5F/D7-45301-F881DC75 for ; Mon, 05 Sep 2016 03:02:39 -0400 Received: by mail-it0-f48.google.com with SMTP id e124so133630435ith.0 for ; Mon, 05 Sep 2016 00:02:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=EQjNP8a2SouNs1fon88l/jiNcUiCA+n5GQ8K/GIQvIk=; b=m5y7MaekiPtyYmZbgP2I96EPcZDCUoTeOwSEiE60u7LBHSGCHvIb4afdPyz2KzENpj VQkpDuHqiIgalb6cx9ungF0Rw9COytlZNiRq2I5IFQOk6kAeuSYjViy4rMbjxW17My3B cq2xfcwMmbAM4/yUpnQHWEHOcCXxPWNF64RvoPMgh6AGZaBXMnCt6qyP9kXRtwPj5vxO cTfVmQrka9uSuN8zI6Ve3YjHGrYpN1dG3gCz6WikNS/8R3hV06NSQ8vs2zJMJPm1hTzw neyTp9du37lH8rHHkqixnlPL0sGnc0XrVXNpKoxj1k6eNmrSOJBXFfeD0tpLmtMuS67c +lrw== 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:cc; bh=EQjNP8a2SouNs1fon88l/jiNcUiCA+n5GQ8K/GIQvIk=; b=aw8vdMY/7VMcMtQcqHYgEzW6kcQeDWpLglKg5ZbQgcoCRflwPZs9xO7w/EgsfeNWYJ 5T5DD9yuoW1UOmz+GHyt8ayPtNUhGXK1lnANLVpKTsVunoonZ2evP3CtesNiqZkBUc15 sJjPFw3oGksDMcvf8a8Pv//F+3l10ec6Uy9sBhz9w7v9wm1qw5DaRKbYqFDrYtU5S9WI mTIk53BgUvZHGvq5/x1B20PT88ItkbApvabiOp/s/GZTyLt24auJsbFpwyI5UGsOHlmJ gOIJ4FYcI1w5otGv8TN36NpX3EuRPHL6t1YuB9nzzupCAjhLbRI1a7PFMNOMFgm0ws/w pQSQ== X-Gm-Message-State: AE9vXwMnUFNHGYzm24k/qPC+VbWePtzSdawsTtkZ8NmZQEOmwiheX66IPksvv1CyZYyFuzSxCYWc9L15Sker3Q== X-Received: by 10.36.64.142 with SMTP id n136mr1174614ita.16.1473058956526; Mon, 05 Sep 2016 00:02:36 -0700 (PDT) MIME-Version: 1.0 Received: by 10.79.137.130 with HTTP; Mon, 5 Sep 2016 00:02:36 -0700 (PDT) In-Reply-To: References: Date: Mon, 5 Sep 2016 00:02:36 -0700 Message-ID: To: Rasmus Schultz Cc: Niklas Keller , David Rodrigues , Ryan Pallas , "internals@lists.php.net" Content-Type: multipart/alternative; boundary=001a1143ae42d6592b053bbd4329 Subject: Re: [PHP-DEV] optionally return class name from gettype From: abacaphiliac@gmail.com (Timothy Younger) --001a1143ae42d6592b053bbd4329 Content-Type: text/plain; charset=UTF-8 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/abacaphiliac/php-src/builds/157555638 it mirrors gettype except that it returns a classname instead of the string "object". i'm not a fan of the code duplication, so i'm looking into a couple of ways to address that. the result will likely couple var_type to gettype, but that is no worse than my optional param solution. is decoupled code better than code duplication in this scenario? does comparing my commits help? how can i proceed? should i open merge requests that reference each other to see if either one is acceptable, or if they need work? should i submit an RFC that includes both commits so that there can be a vote? thanks for your time and honest feedback. On Sat, Jul 30, 2016 at 5:46 AM, Rasmus Schultz wrote: > I agree, an argument that essentially turns it into a different function > is not a good practice. > > Suggestions for a function-name? > > typeof() or vartype() maybe? > > > On Fri, Jul 29, 2016 at 8:17 PM, Niklas Keller wrote: > >> > >> > Niklas Keller wrote: >> > > I'm not sure on the boolean through, I think a new function might be >> > better. >> > >> > In this point I desagree. >> > I think that boolean is the best way, mainly to avoid a new function >> > on userland. >> > It's like an "extension" for gettype(), and make senses just extend it. >> >> >> The issue is that it's not clear what this boolean means just from reading >> the code. >> If you follow Clean Code, you shouldn't have something like that, only in >> very, very rare cases. >> > > --001a1143ae42d6592b053bbd4329--