Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:128490 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 67B861A00BC for ; Sat, 16 Aug 2025 20:33:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1755376320; bh=oPFsXjGQUTR2j7j6qB6BTfM78oPP7CdMHFyRKHDNq7c=; h=Date:From:To:CC:Subject:In-Reply-To:References:From; b=Evuxkyh6qCxV+ai/4KyFZaJLNja6ou7e1xZ3CFplxcH3vzI2K6AbsWgVpU7FM8gNc wEpI/1y6ugkAix96IZUWwHytuwdgAzXaEHaUXxMmmgvHhmFe9go4DohJCSl5k9kAiZ JCgqE2jrin9yKNStQFeIPbnXy2SDmC32eQQA+k1D6h97CDlf4kQ4kCMTZLlOJvYGX8 VfBXfnkexICUpAFT+x5iS8A+3d+e3N4BD1HbnMe/K3FRnXSlBUxXbqECZJxxu3USxo NQGr3gAzkSZ4H6Hy9RLXX3Cr9REYmR61gDBdvyW72F+ztv4Ojf3CHBPDbRhCc89Eoy Ew1eY9aJkDuLw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 0521D18006E for ; Sat, 16 Aug 2025 20:31:59 +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=-1.4 required=5.0 tests=BAYES_05,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from fhigh-b6-smtp.messagingengine.com (fhigh-b6-smtp.messagingengine.com [202.12.124.157]) (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 ; Sat, 16 Aug 2025 20:31:58 +0000 (UTC) Received: from phl-compute-08.internal (phl-compute-08.internal [10.202.2.48]) by mailfhigh.stl.internal (Postfix) with ESMTP id 1C9967A01BC for ; Sat, 16 Aug 2025 16:33:34 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-08.internal (MEProxy); Sat, 16 Aug 2025 16:33:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rwec.co.uk; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1755376413; x=1755462813; bh=CLQuQEOf3Fsb921ye+/zB9FK/Ey6cD8OjOmXfGmf8Ig=; b= Sg7BUvJ9d0vk8WtXUsVbpibJRjrnz6yLWRYPb7eTe5gHLhifUDt47J84rO6exLE5 Fam33CAKDzIb7n+WjCfSeSim3DWgBSrxPeuyq7b2U/bGGtNTT3ffW+BWewhI3ckQ d/U65olUXS+B+JmResizUkuRspAcPAFGtglvDGXGYR4oV3y/gHl3DES7+/twoy4U dWGZ5PlY1zGVMRuGVvYlhgxCPIpe1IKLC4AoV38mFnlYxxNrx4El91x61WeCecqP wLBc461S0kkJijjaMMyN6BnU1Ig5E4vcD7KbL3sxdiUZjSmS7iTqm4QHxLMjWkot 3R9iMuFsWjU2Iu3QQyXdXg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1755376413; x= 1755462813; bh=CLQuQEOf3Fsb921ye+/zB9FK/Ey6cD8OjOmXfGmf8Ig=; b=G vpBZYJHgSHxf0Ci3jSp91r8kUbqF8MKA3ByuZ1dtnbrJWXMUzPuuTWc4CHevQMB5 NJeMiXQ0jPVaaSmqiS3RmeTfAIlkdMptcd9v9OWqwY2Ym+YbGRVuA2D7vyWAVBIG V/sQAE3mHJgHvuwpX0NNQpOmfBrzSSK4xGXYBzBqzQtgc/Jo2tAH7AYfksCl2eS/ flfrMsawlszChjQrTignjBP/d5dURphFVSK0FmTheu3E1NcuD9jzYdTITbZdmbAU ilVZT3/UXD1fcgZpXtJzsx/3UDZ4jQQLEBHTbJGE4yzul1NRs2FvrLtJFrQpVoz+ N4V+IMI3e25YnYaoAyZoA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdefgddugeejkedvucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepfffhvfevufgfjghfkfggtgfgsehtqhhmtddtreejnecuhfhrohhmpedftfhofigr nhcuvfhomhhmihhnshculgfkoffuohfrngdfuceoihhmshhophdrphhhphesrhifvggtrd gtohdruhhkqeenucggtffrrghtthgvrhhnpedtvdefteehhfdtkeefvdekteehudekgfff uddviefggeefhedvieekkeehudehffenucffohhmrghinheprhhoshgvthhtrggtohguvg drohhrghenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhm pehimhhsohhprdhphhhpsehrfigvtgdrtghordhukhdpnhgspghrtghpthhtohepuddpmh houggvpehsmhhtphhouhhtpdhrtghpthhtohepihhnthgvrhhnrghlsheslhhishhtshdr phhhphdrnhgvth X-ME-Proxy: Feedback-ID: id5114917:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Sat, 16 Aug 2025 16:33:32 -0400 (EDT) Date: Sat, 16 Aug 2025 21:33:30 +0100 To: internals@lists.php.net CC: PHP internals Subject: Re: [PHP-DEV] Split as an alias to explode User-Agent: K-9 Mail for Android In-Reply-To: References: <275514FF-2AF0-48D6-B57B-23B18ECCEED8@gmail.com> Message-ID: Precedence: list list-help: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: imsop.php@rwec.co.uk ("Rowan Tommins [IMSoP]") On 16 August 2025 10:16:40 BST, "Christoph M=2E Becker" wrote: >Because it would still be rather confusing to JavaScript developers who >are used to > > str=2Esplit(separator) > >and now would have to deal with > > split(separator, str) The fact that PHP doesn't have methods on strings, numbers, and lists, is = something you learn once and applies to dozens of different functions=2E It= 's like saying "it would be rather confusing that you have to write split($= foo, $bar) instead of split(foo, bar)"=2E And why focus on JavaScript anyway? Have a look at this comparison of how = to "tokenize" a string in dozens of different languages: If they have a built-in implementation, it is nearly always called "split"= , regardless of whether it's a method, a free function, an operator, or wha= tever else=2E Apart from PHP, the only built-ins called "explode" appear in= Modula-3, and an obscure teaching language called Basic256=2E Let's face it, "exploding a string" is a slightly odd metaphor=2E I wouldn= 't be surprised if it causes extra confusion in people who don't speak Engl= ish as a first language, as well=2E I can only assume the original split() function came first, taking a regex= because of the influence of Perl; and explode() was chosen when hunting ar= ound for a distinct name later=2E I do accept the argument that aliases can lead to confusion when reading c= ode that mixes them, though=2E I've seen people completely convinced that s= izeof() means something different from count() Rowan Tommins [IMSoP]