Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:128486 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by lists.php.net (Postfix) with ESMTPS id 336E31A00BC for ; Fri, 15 Aug 2025 21:47:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1755294348; bh=DDoyC1dDL3qhy3g/JwFpW2jMwC09An88YqHsJL2YGWM=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=l9TbBIQGj+L3/sTR3hstpgemEPWl8cjRNQvriwubWBgEhyOLlr3qJXIGKVsHVO7GI 3Rqs+8m+uFeOd1uoYgev5TydveMGinuVeP0O+YVFcih1E4rL4cpBdtRGz8L3A5TzZ8 k+aXkBzhxJuaZPZuWpsLEB/KywQEhO/ZvPxW4ZaAjRR7w+aRN7tNkeDdpDcIsPLNhp wFbdwU+ZApIsvXj92iUnBnV6VfOwaasAkfkCJs7zP36blQYEovOe5ov0IudGVaiiLx or4v6HTLV47OB2K/c4puHnHTnLowdbdQt737BBY++KIDVCSNz3XDJv6pv5FlqWwYsi haiYikI7J2ezw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 7DD2018004F for ; Fri, 15 Aug 2025 21:45:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-0.4 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from mail-lf1-f51.google.com (mail-lf1-f51.google.com [209.85.167.51]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Fri, 15 Aug 2025 21:45:44 +0000 (UTC) Received: by mail-lf1-f51.google.com with SMTP id 2adb3069b0e04-55ce510f4f6so2463931e87.1 for ; Fri, 15 Aug 2025 14:47:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1755294439; x=1755899239; darn=lists.php.net; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=DDoyC1dDL3qhy3g/JwFpW2jMwC09An88YqHsJL2YGWM=; b=VvlqrUPlotDf/S4nQV8dFgUUF14QSNxz6NhEBrvkAY9T3xB2q0nhopJbJBOaZGBrG3 il5gHmkS0q4Oe2EPIxwk+Mq/ack/8Cfgpd1ixLXXvE3L5gixMarQ/HytJy8SJDWbWu5x ZGMErg7iISZSmcJ+7dvDs5ATo/nY7Xr0Em5RRgxaWVlP+GdoEwwjAFcUgqSjQPqyCSXS jsj5xUnXYwKBmTzkbDERiSNFaDhNb/Prc0Eqr0yv2uOrlPGD1gvIY8qJIjFQtjqSx1pe 5aJDqNxYjIH4JC9NSaSGPUQ6hdnVmjqDNZzHc2RX3js5JAyunHiA/jbFwJvSIEI/kl0n almw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755294439; x=1755899239; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=DDoyC1dDL3qhy3g/JwFpW2jMwC09An88YqHsJL2YGWM=; b=uOJG+oU6WknaCY/7YnkbqEq2oA3pJdTcotLiJQec5ZwwqA7fFu2f34JZwamt+4RIns lzXM93qj5F18mrwl/BdFVL8Dpep9BLldoxiuYeVI8pc3ZppbIhhHMHVu9pLEAivSMdoY 7y4rLFki2WRqRxyTFyMeIvOz55KZgSYkYFoSFns5A4MJxlBQWiAhkhfcITcb9w85vJ/u iulvsqsu5J5caP1OWOyeo8PDF/AKS9MxKieFB68rvoSCbEVhunBWRIhPSEDF9zzAE7Fy JHNirqm4WhTZGKIFnKhRz+BOaLeu+J4uvtnk3CURBZbUvK9AwpDhcNvJSOQEUIC3OinD KstQ== X-Gm-Message-State: AOJu0YzDSTKAyomASGPX4ufZkt3fMLTlNeqThXE7FoZMaDCOOfMTuyqb CYohzDiWex31Q0Dn8trPzEgMffZRpe27KGvnDSvgEakuozdsyGB26iF+ZDFybwxVHIBOUuOI8Ik GxAxSJCJD3dTsbMyDNyjV+hIEGWKVnkk= X-Gm-Gg: ASbGnctOEPULELLlY89USQv6Q5B9avQZ9ZoWeXfcYqlF14M9Jfj05Tle4FX9PPhGlzu v0sh/wq6GXueoW7ehMDvoBMqnSEY0QmwR12uXf3zZj3C4u+4Ll9VytfxbliYpQ/+xo7boWPI0bp Auuf96YQpahvPDoI8j4YAjJCP2FXeVq6yynccYL8nChLF4jIUJFw9MNKbpgrrsFwRiU3EXpKFGP ONssgwM68lNej6Q3dA8C/k0oafglg== X-Google-Smtp-Source: AGHT+IFQ4yGlY7267a8CNbIXDrw1lgUDslS/7Y4EPGmSnXEUJgHnmR6jx2AmQH9hF42zIo7OUkYlH6mwKF+zfo1yUaY= X-Received: by 2002:a05:6512:234e:b0:55b:893c:cdd7 with SMTP id 2adb3069b0e04-55ceeae4253mr1058264e87.20.1755294438703; Fri, 15 Aug 2025 14:47:18 -0700 (PDT) Precedence: list list-help: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 References: <275514FF-2AF0-48D6-B57B-23B18ECCEED8@gmail.com> In-Reply-To: Date: Fri, 15 Aug 2025 22:47:08 +0100 X-Gm-Features: Ac12FXxp2MjmQDFksbEgI-dT1YcQXjLXQC3hamzaZVt1ZpBCFH9ca_a13RTLOgs Message-ID: Subject: Re: [PHP-DEV] Split as an alias to explode To: mickmackusa Cc: PHP internals Content-Type: multipart/alternative; boundary="0000000000007ec5fe063c6e554f" From: dragoonis@gmail.com (Paul Dragoonis) --0000000000007ec5fe063c6e554f Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Aug 15, 2025, 10:30=E2=80=AFPM mickmackusa = wrote: > I don't see any benefit to re-adding split() to the language. Why create > more keywords for the sake of a function name with fewer characters? Code > golfing isn't a goal of the language. > > Rather, we should be going the other way and removing aliases that are no= t > needed such as chop(), sizeof(), join(), etc. > > Adding new function names should be done with a particular benefit in min= d. > > For example, create the preg_escape() function and allow its first > parameter to be scalar or a flat array (like multiple other preg_ > functions) so that you don't have to call preg_quote() while looping an > array of terms before imploding with pipes to create a dynamic pattern. > Then the semantically misleading preg_quote() function (which doesn't > actually add quotes) can be removed and the language is left with a more > usable, more indictively named function. > > My 2 cents, > mickmackusa > Ancient history aside and forward looking; JavaScript took a huge boom in recent years and overtook PHP in areas of new adoption and code DX Making it a smoother transition for JS devs to hop back on the modern PHP train is in all our shared interest in terms of user base, and split() would help this. So why not? --0000000000007ec5fe063c6e554f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Fri, Aug 15, 2025, 10:30=E2= =80=AFPM mickmackusa <mickmacku= sa@gmail.com> wrote:
I don't see any benefit to re-adding split() to the language= . Why create more keywords for the sake of a function name with fewer chara= cters? Code golfing isn't a goal of the language.

=
Rather, we should be going the other way and removi= ng aliases that are not needed such as chop(), sizeof(), join(), etc.
=

Adding new function names sho= uld be done with a particular benefit in mind.

<= /div>
For example, create the preg_escape() function and a= llow its first parameter to be scalar or a flat array (like multiple other = preg_ functions) so that you don't have to call preg_quote() while loop= ing an array of terms before imploding with pipes to create a dynamic patte= rn. Then the semantically misleading preg_quote() function (which doesn'= ;t actually add quotes) can be removed and the language is left with a more= usable, more indictively named function.

=
My 2 cents,
mickmackusa

Ancient history aside and forward looking; JavaScr= ipt took a huge boom in recent years and overtook PHP in areas of new adopt= ion and code DX

Making i= t a smoother transition for JS devs to hop back on the modern PHP train is = in all our shared interest in terms of user base, and split() would help th= is.=C2=A0

So why not?


--0000000000007ec5fe063c6e554f--