Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:128483 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 96ECD1A00BC for ; Fri, 15 Aug 2025 21:19:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1755292644; bh=FjKuj0rFO+fFIktiAeY2gaFhMXOyV/fvLoem37aIgms=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=QaWqm18qvObG8WRbeuPB7C4cl51xcapg8COAobQgiTBBV/jV+fki3btnS5PsUqXbx mS7N5SJqi5InKxUU/AlBq9OpaBzIGWAU2zNdwqblc1EzYa5X6LkdtWENChv+LFyele Fmx97m7WtVwMFnq1w3l/e2dtH/SdX4d66V2AtGc+DtxC/8GT9KEBDs2il7+f8aII1N ymh9idA4wLIXZHMK9drUbmx8e2uK2AsrXttWBeQsHv8CWDvloHL6EmDtB3na/x71g6 aGJ3kRAicay3XL3Uv6nK+MOoGWLZNKy+kuSZKjREtsxL03lq2J2k8D+q16ABtQM6wd 1VcE7FoZ2qkxg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 2DDF518007E for ; Fri, 15 Aug 2025 21:17:24 +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.0 required=5.0 tests=BAYES_40,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) (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:17:23 +0000 (UTC) Received: by mail-pl1-f170.google.com with SMTP id d9443c01a7336-244580536efso16816295ad.1 for ; Fri, 15 Aug 2025 14:19:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1755292738; x=1755897538; 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=FjKuj0rFO+fFIktiAeY2gaFhMXOyV/fvLoem37aIgms=; b=PZ9LLf7sFmWEOE0pDHp457OEMykE0Pb/HDnQxszUwpBBr5A1hd8IIPWrRYvhxyKa01 eNAd50R3kfIY5OMsxDqO/TVqqZpAEFoEZbNus2VSpR+DoZyxWrs+yClkgDHpwPJ40Xmi 3xRpo4zyYxnLrJ338VkFODhpvQp+Cem/Cy1+ktyQmXMuG+6d4I/Rpb6ErsWg1ApIkYqX fr7FAaJhei8+eMk6OYnJQ26XCKUP+8cFYYWSeWa0qocUaqfkU2IlYLLoM1G0fkUdOVP7 z7YllD7rzmBcquzzKKU85wOzN++6R3nqvwjPqwezsafR7sfVhGnyUEGcPufMbSc/SJIt ++yA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755292738; x=1755897538; 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=FjKuj0rFO+fFIktiAeY2gaFhMXOyV/fvLoem37aIgms=; b=vfymlOfzPcyBdlMkKDenTzFa7dpHToI+LmnjAeEueDBUwCl7blary5PGymZq1VI+H2 BQMtqVusRXJ4LIgkSgOD7vUrFwwG3FONFAL7S/1EwVG6nOLiKd+NmC0zrWeAM1o8HEjd kIT9MseSp8ZP96hDdJgYW4j7oEUvinExYU9T43nMuaZHGrYzfYeU3+8FG0GK+J09unYz bt49KvPX23JoDuKxLYP6tTkOmbeTBKpRBKQ7QjN2Ee4LZ5/hjysePEmpwZXRBdJ2FwKP f9QkdCFeOKlCnocxe6iId+5Ek2Q3RdJG7zD66y3Rx9zvEI029c5mwH5tg+KurdtprE2c 1JBQ== X-Gm-Message-State: AOJu0YyuMklmS1TAAVufMNUgzmxrJADrC0Dpj/ktbNJERNPRJlbPBen+ eUwU2hLtdgyU3RQmr0iQqrqdVuNsjLLvXsYDndhsJ7F3DCufj6jumyu8N+qg+l+asMUNuYeE8Ot NPUSdrtYMKnR8iUjXt1DdBKK9OyDOCDIHkUYe X-Gm-Gg: ASbGncves6NiWk5fLYZNfzGHhL/4VqCA2MoY7/eEt0Xm0gcFViikyJDNR+h83I+icN1 psVXIYT40Et21BzUBRtvFnvkE1oZEJr+WlNQUMuxeiPkqtZ/dEgIhtmZYCBpO+TgDO4GyiMe3tS vhml5bf1RIeds2mL8pxuV6rv5ifc3Pn3FnG7UcC98+IgOcXQIe51dLQbEjsSeM0+l/v74vT9YRR WIR5G8rQw4viMs2EE4= X-Google-Smtp-Source: AGHT+IEm1ENkFdooRi0WFceOoLBKkJu4uE2gTG4c2oySCtsd1U5mcQPDlIPZi+J71b/TYyq2bGKWoy+saSTLiHVIocE= X-Received: by 2002:a17:903:1a84:b0:242:a0b0:3c1b with SMTP id d9443c01a7336-24478f72797mr7662035ad.30.1755292738495; Fri, 15 Aug 2025 14:18:58 -0700 (PDT) Precedence: list list-help: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 References: In-Reply-To: Date: Fri, 15 Aug 2025 18:18:47 -0300 X-Gm-Features: Ac12FXwrHIot7vmm8eO9hg4nkQeWs7ceXI1QCVdd9eZEuJ1GJ2b9Y7K0Pus8JnY Message-ID: Subject: Re: [PHP-DEV] Split as an alias to explode To: =?UTF-8?Q?Tim_D=C3=BCsterhus?= Cc: PHP internals Content-Type: text/plain; charset="UTF-8" From: carlosv775@gmail.com (Vinicius Dias) > We already have a function named `str_split()` which does something else. Adding a function named `split()` could cause confusion. I totally understand your point, but I also think that it's way more common for people to assume `str_split` does what `explode` does and get surprised when they see it's not the case. I had this happening during a few conversations in PHP User Groups meetups. I agree that having `split` and `str_split` with such different behaviors isn't great, but I also think the benefit for newcomers to the language to see `split` just like we have in several other languages outweighs the possible confusion. --- > I don't see value in having multiple names for the same thing, that will just cause confusion for folks that are used to the other name. This is also a very valid point and I understand this line of thought. My thought, though, is: people coming from different languages are used to seeing `split(str)` or `str.split()`, so this would make PHP a bit more familiar for them. Small changes like that can make a language more "liked" for people learning them, IMO. > As implied above and also indicated by the changed labels on the PR: RFC please. No problem. I'll send a new e-mail to the list asking for karma (or can this message in this thread serve as the request already)? Thank you.