Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:104350 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 18829 invoked from network); 11 Feb 2019 21:33:03 -0000 Received: from unknown (HELO mail-qt1-f179.google.com) (209.85.160.179) by pb1.pair.com with SMTP; 11 Feb 2019 21:33:03 -0000 Received: by mail-qt1-f179.google.com with SMTP id 2so13290801qtb.5 for ; Mon, 11 Feb 2019 10:15:45 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=9D1zBJ0qJzqyGG1tIVOgZMI4ec79a9F7ElyuqgTdXpY=; b=fOhvQtbme69R2cVY5ICFEMDfE/h18hwFD+gUT5bjKY9KaG9W5ByWJW6yHJTMMhRN1D sOrBOf8h4eZFRORwKlkzuBuS5/FXeht5+w7LRpUn3t8nRFRIiCXEEUL4Xqee8g8qNuqT vlue/CyjQMgztmF6Mtkl4edsdTkB+W/K7VmJh3KFOyzelQZ190Mb67WSDsZ70XrKG8ut A/PpwheouHtmIg0kOwVw+u/16qZlypls9el/ovIr05kcKp/ruEbFq3t57m9yvaVWR8e5 zfQO6JxVwg9xDkA8YDMdHQWpTLV0DnZcg/dP0lz8fKNUaKihYHJPgsKW0f3M8qCEl/gQ Lt0g== X-Gm-Message-State: AHQUAuZf3uwmLOU7w09ARAe+iNJKqgc92StHHAGB4QynLgkWB9S1CikX MNPXknPJHg+Uh+pF0NfZyIgHJ6pMaBKnhkhGqnFZYw== X-Google-Smtp-Source: AHgI3IYepGQ+ZaBgnmFpj8nPxss6iYakyEB+TpoxOZunsoLm2kLVE/gTSbccNJerco1UHPFfXwvI5GFNrp7nWh5IuGk= X-Received: by 2002:a0c:baa8:: with SMTP id x40mr27976601qvf.18.1549908944865; Mon, 11 Feb 2019 10:15:44 -0800 (PST) MIME-Version: 1.0 References: <5437a651-8263-49e9-b87e-d8d052d66c99@web.de> In-Reply-To: Date: Mon, 11 Feb 2019 12:15:33 -0600 Message-ID: To: Levi Morrison Cc: "Woortmann, Enno" , internals Content-Type: multipart/alternative; boundary="00000000000017e8490581a24c98" Subject: Re: [PHP-DEV] Variadic is_*() functions From: pollita@php.net (Sara Golemon) --00000000000017e8490581a24c98 Content-Type: text/plain; charset="UTF-8" On Mon, Feb 11, 2019 at 9:59 AM Levi Morrison wrote: > My position is the same: pushing the variadic behavior into the > functions means that each function needs to pick `||` or `&&` > behavior, both of which are useful. > Additionally, I recall from that thread (or a similar one on the same topic) some pushback on isset() even having behavior like this. That it should be considered a mistake. Not saying I agree with going so far as to call it a mistake, but it does seem to have been an less than ideal choice. > I would rather see more > descriptive function names, such as `all_of` or `any_of`: > The feels like your C++ experience talking. :D I do agree though, I think this model gives much more power and flexibility, I'd also favor such functions taking iterables (as you show in your examples) over variadic signatures (as shown in some replies) because this allows the short-circuiting to halt generators early as well. > These do not need to be part of PHP core, but perhaps they could be. > My preference is for the community to build what they want in userspace, then worry about teaching the engine to optimize the pattern when it sees it. -Sara --00000000000017e8490581a24c98--