Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:123015 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 qa.php.net (Postfix) with ESMTPS id 8C69B1A009C for ; Sun, 7 Apr 2024 14:20:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1712499675; bh=GiwL7KRDAncttGnDaZKXtbl4rHMSmB2YfV2FBsKMcJo=; h=From:Date:Subject:To:From; b=Mc3kn6u5MoveVFFji/1efoDdghD2zptkBfH6NzK9XH9FDO5EtnQug4hG5g2efBrhS ND0YpAqzEht1nwDBZ2VCVehF7iXxCDJF09c/Qak2O3dUrE2Vy4x1x6h4NgGCYtP9nA w7fKRddozUcfWz+mQUWCNlsy09q6vWa/jhZrlKowVx2e0hKlUnGsc4SbGQydvYsuna /NMz8WtFCT9iHyQxgh2Fvie0iHdwmNgFGuyzksyq0pzk/3KkmQIE7MJTaepwpvukMO T9xh4eureqek/k3i4dPFn8SaNjkFetumQR5WbbSEwveLX2XBGIL7crsgmW1jeUjXF1 L+pMoS8n1kiLg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 603831801DE for ; Sun, 7 Apr 2024 14:21:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) (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 ; Sun, 7 Apr 2024 14:21:13 +0000 (UTC) Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-41650de9e1eso2617765e9.1 for ; Sun, 07 Apr 2024 07:20:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wcflabs.de; s=google; t=1712499642; x=1713104442; darn=lists.php.net; h=to:subject:content-language:user-agent:mime-version:date:message-id :from:from:to:cc:subject:date:message-id:reply-to; bh=h17HgzCwAi8lkkevV+/XeYFobreRF1eVwPKoC2dbEq8=; b=JfhfH6Fgo6xXAe5f8oL0M85G6kjUnt3MnrsRkH5dT/jd6IFIF1nduw1IX8wHVCGm4o RfxErtNTjacSTphM+wqqR2B6ga5sZ2QoorV5GXQd/DO2UwhmEyU4Gr9MyVngLZiihNSc fxNvoq/0IVNKMPYG/Nx5G8erpVA6LjHsT/tAyPzRifDK5DFptKgnVbfoKWvk5iSNH4iL nybDZWLaWQc0Eibqw4O0jjvFIbS4jI9eJ7pHYz7N/6CuHWyPggtjEMbM+h8xaObx0KHe MdbiqVtmCpkTKW+eNBDJ34Ca9YfUCqk4u88HB95M+8Pm2ociY5I1lrDChgp/2ycIEePo dviw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712499642; x=1713104442; h=to:subject:content-language:user-agent:mime-version:date:message-id :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=h17HgzCwAi8lkkevV+/XeYFobreRF1eVwPKoC2dbEq8=; b=GDes/fql9iagYAMJ6Wv7/DyY7/oX2ULC0us25dYmejeMIJuSvLlkBDx0q27X+3wR7r gN2MWOG8h3nDcZO/EXtzY7LUftCyhGpef2qY8036zXBo9/tHpl4KqciDvL+19YmAEaEs J3EblZtFmq8bw6cNgoCy23wTZhlQJknTwUCpmJmHTP14l5+dOuhnRAj6E9N2Z0uGvu/0 zfPJgioV28aFfLMR5B+q+heZfXdUrV+aMszDvFhtvjeGbWIEVOnnp6qZuoQCpX+m7cpN JmlHnP53WJwYeXg87+8ha92emdHlxITu+AGFK29nqGtbFeMJ2NEshkkKA7QgMaue/EOh TkuA== X-Gm-Message-State: AOJu0YwSeR2JJ2KT/D+PGku9hB8FMmeTwln7pgIldpKyHuu0FCwbm77f bfzuhiqCVHcMT9EilgBwIelUiyfrJv+fAm+yQmnmD5j3Az4bt7dfWpycizdsjEVzL1fIF7ynEXE E X-Google-Smtp-Source: AGHT+IF8by00uYNkgaS1JoEN1x7ZQ0vLVzYAIqesL0gu0lFADORWQH6vC4CC1CAUx8e+0dHv51ENNA== X-Received: by 2002:a05:600c:1d1b:b0:416:4eae:9adc with SMTP id l27-20020a05600c1d1b00b004164eae9adcmr1792209wms.6.1712499641456; Sun, 07 Apr 2024 07:20:41 -0700 (PDT) Received: from ?IPV6:2a01:598:a029:144e:d19d:a0b0:5b39:bb22? ([2a01:598:a029:144e:d19d:a0b0:5b39:bb22]) by smtp.gmail.com with ESMTPSA id c9-20020a05600c0a4900b0041638a085d3sm5605723wmq.15.2024.04.07.07.20.40 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 07 Apr 2024 07:20:41 -0700 (PDT) X-Google-Original-From: =?UTF-8?Q?Joshua_R=C3=BCsweg?= Content-Type: multipart/alternative; boundary="------------lN30d16yUCoVksAWHEEWRR6t" Message-ID: <24e4529d-0b75-44de-90ef-34de5dfb1c99@wcflabs.de> Date: Sun, 7 Apr 2024 16:20:39 +0200 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: de-DE Subject: [PHP-DEV] RFC [Discussion]: array_find To: PHP internals From: josh@wcflabs.de ("=?UTF-8?Q?Joshua_R=C3=BCsweg?=") This is a multi-part message in MIME format. --------------lN30d16yUCoVksAWHEEWRR6t Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hi I have created an RFC to add the function array_find which returns the first element for which a predicate callback returns true. This is a function which I missed often. Furthermore this type of function is implemented with other programming languages like C++, JavaScript and Rust, too. You can find the RFC at: https://wiki.php.net/rfc/array_find Proof of concept implementation is in: https://github.com/joshuaruesweg/php-src/commit/9f3fc252b92f534d498e5f1e6a463e15f45da208 I'm looking forward to your feedback. Cheers Joshua Rüsweg --------------lN30d16yUCoVksAWHEEWRR6t Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
Hi
I have created an RFC to add the function array_find which returns the first element for which a predicate callback returns true. This is a function which I missed often. Furthermore this type of function is implemented with other programming languages like C++, JavaScript and Rust, too.
You can find the RFC at:
Proof of concept implementation is in:
I'm looking forward to your feedback.
Cheers
Joshua Rüsweg

--------------lN30d16yUCoVksAWHEEWRR6t--