Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:128479 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 8002C1A00BC for ; Fri, 15 Aug 2025 17:05:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1755277406; bh=XBiyrAWwfHb0ypbWVEep8UD6jOOXFsQgktZbWq0surQ=; h=Date:From:To:Subject:In-Reply-To:References:From; b=KflI4bm78iVJbUEjXcOoVJXs7manP+gICIb48CsO9Gkyn1pwVwUKw3jnQsy2kN3yw LJ/BKMqYGK34FbLifctO6CLG/8WoJCsvpdXudRZKkdIIIrOo2eYxtv9oIIv1IkeBFA kuHOOkxFDgd9w9dSrv6RzVqRfoXtXpaDi+h2TvqwRAb+uxc4sfzKF/C0l6aigpPcsj CTqeu76WCcylsDQRbHVX87gWXk0kr6XaGlEyH4Wa/4tMHeS2Fxq3lF4/J9ZPuCBK96 rCOBJt4Q6eRIp9yvt153A2e10S8iRcqYcqTRyLJOv4NU5W8/0TM8qsme/eupSm4zjN oCDcotaiGgJ1A== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 9FCA918004F for ; Fri, 15 Aug 2025 17:03:25 +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=-2.8 required=5.0 tests=BAYES_00,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-a8-smtp.messagingengine.com (fhigh-a8-smtp.messagingengine.com [103.168.172.159]) (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 17:03:25 +0000 (UTC) Received: from phl-compute-05.internal (phl-compute-05.internal [10.202.2.45]) by mailfhigh.phl.internal (Postfix) with ESMTP id 390731400073 for ; Fri, 15 Aug 2025 13:05:01 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-05.internal (MEProxy); Fri, 15 Aug 2025 13:05:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rwec.co.uk; h=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=1755277501; x=1755363901; bh=XBiyrAWwfHb0ypbWVEep8UD6jOOXFsQgktZbWq0surQ=; b= VzyXc3hsROVdn1C+4s6++RWYj0bQY870gaydysYQB7b68J+vje7S5R0kcTTha3gz Td73xeZfiB5kMYt/tyHrQFBdZTrqX2yYUsmZYbxnEJrZ1RnYuxXb+lNOw1c/J0ox oQ5lhpY/TQcJjVx/uE3MGMW8HCC+v8e9rI+ONJBEfHiakPzhG9UiZTdtdsfGghU/ SKpTOf1eYfJLioiqQxnLkERd0cERemzwsq1pM+vFBsiMvlb22aQRA8R/pqHqgVsj XQ24GMUNQ+uH4ywfarM2Lwu3xnly+IEoDwiYQTKAtX2sa5725j3TJbSTT6/sLmna GJ25kRmsvo83bDQnLQGwKA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=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=1755277501; x=1755363901; bh=X BiyrAWwfHb0ypbWVEep8UD6jOOXFsQgktZbWq0surQ=; b=S0L9qxiid6vJdxEVz ek2DagZkFx1zlBXGWEn6b0usm9XhMhR8nWIrz2KdVqIo0/PVMx7O2Xm+iDYc6Zm8 /9qdRDfWfXoTSkI3C4eAImj6dZSHxDYfYIM7PAwsZgneBM8tJI+Up6HHR7yfY6tz cesr5F7sg+4sMzKjT4rySEOW9uqTUZMmL0ddItctSWyak37ico8T2ZQkhs+4e54o VCGGxH3V+Py/3HwPhHpo/T3zWnSl5xQ6rpEjH7+7mVJOb+UQ8uJUx4JtUya8+bAt JVcZACBYoLaXfE7C/TUO1NsxrlXSy9+wRgBFb58gFDptPuLEdZEYR5FzxbzwYrBh sSkJA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdefgddugeeghedvucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepfffhvffufggjfhfkgggtgfesthhqmhdttderjeenucfhrhhomhepfdftohifrghn ucfvohhmmhhinhhsucglkffoufhorfgnfdcuoehimhhsohhprdhphhhpsehrfigvtgdrtg hordhukheqnecuggftrfgrthhtvghrnhepheelffetiefgveduteefudegtdduveeludeg ueegleehiefhhefgtdekveevgfelnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrg hmpehmrghilhhfrhhomhepihhmshhophdrphhhphesrhifvggtrdgtohdruhhkpdhnsggp rhgtphhtthhopedupdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehinhhtvghrnh grlhhssehlihhsthhsrdhphhhprdhnvght X-ME-Proxy: Feedback-ID: id5114917:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Fri, 15 Aug 2025 13:05:00 -0400 (EDT) Date: Fri, 15 Aug 2025 18:04:58 +0100 To: PHP internals Subject: Re: [PHP-DEV] Split as an alias to explode User-Agent: K-9 Mail for Android In-Reply-To: References: Message-ID: <88658822-7BB5-4407-B9E1-3A617DAE7581@rwec.co.uk> 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 15 August 2025 16:53:52 BST, Vinicius Dias wrot= e: >Hello, internal folks=2E > >We have `join` as an alias for `implode` so I think it makes sense to >have `split` as an alias to `explode`, doesn't it? There's some history here that won't be obvious to anyone who has been usi= ng PHP for less than a decade=2E=20 In PHP 4 and 5 (and maybe even earlier) PHP had separate functions called = explode() and split()=2E One split the string by an exact delimiter, the ot= her split it by a regular expression pattern=2E For many use cases, these w= ere interchangeable, because a pattern with no special characters in was ma= tched literally; but in other cases, it caused a lot of confusion when spli= t() gave unexpected results=2E=20 The entire "Posix-Compatible Regular Expressions" extension (ext/ereg) was= deprecated in PHP 5=2E3, and removed in 7=2E0=2E That included the split()= function, leaving us with only explode()=2E At that point, making split() an alias of explode() would have been possib= le, but unhelpful: rather than failing with "no such function", existing co= de would have subtly changed behaviour=2E=20 However, we have now had eight full releases with no built-in function cal= led split(), so the chance of somebody upgrading in one go from PHP 5=2E6 t= o PHP 8=2E5 and missing the change seems very low=2E If we wanted to be rea= lly conservative, we could plan the alias for 9=2E0 so there were two clear= major versions between removal and reuse of the name=2E I believe straightforward aliases like this are a single line in a stub fi= le, unless there's any compiler optimisations directly referencing the name= =2E As such, I would broadly support adding the alias: split() is the obvious = name for this function, and as you say it would mirror join() Cheers, Rowan Tommins [IMSoP]