Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:123266 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 E87911A009C for ; Fri, 3 May 2024 18:47:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1714762074; bh=wjRHBUihUsRQDrPJIHWZe/TOd3YCBFFPtRE9SYjGq6k=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=Abqpz3+7lPwinupP4JR497NRgfPBRz2JeuPqRu580GvqRoHEg+79T/KqxmB5cPtJd acekl0+/srTd4Bfg6bk8X5O44CwE8cq+Pz5p5wdJ4cs/K0rrqBAPBJdBS9VwH4QI1E TZgDY2zFRNgYPgng9Cj7yRfEIWBfwSM075swow9LzFps408vrETDDwQtGdkkl8t15y mvuP2lp1YpJMz8onjnholqaOgAg8wSUAHZ8Qw5pvOdo03kp1e+erbboO5U+VE0QhCf Qmgba6Y+fhukVGpJrQwc7IE/DVznu96oAlHSq/94MxJyBT+dehvvTxU2NA1lQ5Xo8K I01u6Lg1uQsZw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 85832180069 for ; Fri, 3 May 2024 18:47:53 +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.1 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,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 wfout4-smtp.messagingengine.com (wfout4-smtp.messagingengine.com [64.147.123.147]) (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, 3 May 2024 18:47:52 +0000 (UTC) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailfout.west.internal (Postfix) with ESMTP id 07C1F1C000E7; Fri, 3 May 2024 14:47:04 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Fri, 03 May 2024 14:47:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=beccati.com; 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=fm1; t=1714762024; x=1714848424; bh=0GbUIjEvQTQzKFjhi8t43pEdz3yFxVFfDGr85/3vB3w=; b= UG12/k0okqOsQdTydV6KUFew8ihGUWPtbMfGUpVr9JJu7BHKVKQVOLiw98ERwK9D iddR+K2xrez9b5oG8bCU7sRdRmU8SFbg/wGKc+38DRR/8WJ5sc+e4OlqEJjl7cW9 V3pLsxzXnhknn/SOnCdqfuBrzqYCjUEwaI9fDG/Eup5fz8iUC6TQRBK/miZuA0mP 79u2bFxXOV7FsDjL6mVSntzv4B3r4RSY1/7y/qMG6FgahaXpwgu7Ldbj59tRmIKP f7PRKcQIM3csSleo3xQhaAz+iQySaSH/BJn/GTrnzX0HulnjTzBW9Q3pgu3tceYi OUlzUSbWWIHwTy/DeKu17g== 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-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1714762024; x= 1714848424; bh=0GbUIjEvQTQzKFjhi8t43pEdz3yFxVFfDGr85/3vB3w=; b=G HWjz1b8ihmW6+lz7eZhCFpNClOwW98VLza/k1tFXV9sRfvTtydMIjpm1YAXGh2az CegLHXEMDiQkbRNsp8M3SDUuxJ59WpOui4/qujAg25o4c4T9vDZ7CMmZaXbbmvEB Mn/G5ChinB1X43Qw/+erQXR229U+ASdEUmYMZsrZ8FZI31vEXVDRtr2A/CMs7bAC JQ21BHHqDcEcB8RmuZ8QaI93MtIkhL6q3W23H26wGiVPyv/II8lM0qdcGQgca2uQ oJPu2exR/1r+0itGuLc+SDKgPUoh3cxiwFlRKLjGnGB8+dC1LiAZOH1aY8mPjdQl ycPKVILqIaHUrgb42nOYA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvddvtddguddvlecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefkffggfgfuvfevfhfhjggtgfesthejredttddvjeenucfhrhhomhepofgr thhtvghouceuvggttggrthhiuceophhhphessggvtggtrghtihdrtghomheqnecuggftrf grthhtvghrnhepleefhffgfedtgfdutefgtdfhiedvledvtdekgfeggfehgfffkefghfel geegueffnecuffhomhgrihhnpegsvggttggrthhirdgtohhmnecuvehluhhsthgvrhfuih iivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepphhhphessggvtggtrghtihdrtgho mh X-ME-Proxy: Feedback-ID: i6f4c46c2:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 3 May 2024 14:47:03 -0400 (EDT) Message-ID: Date: Fri, 3 May 2024 20:46:59 +0200 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PHP-DEV] Inconsistencies between parameter number and index when reflecting a method/function To: Hans Henrik Bergan , internals@lists.php.net Cc: "Gina P. Banyard" , Derick Rethans References: <88ea5de8-22ea-4c23-b570-229acd546c10@app.fastmail.com> <28215C90-191D-4159-9C47-86D03B9A683D@php.net> <63GXg3pF4DIRrXn-zuvO46emeZTrmkMOuiLUFwDA18PdV0y8BNqFvwidOxktGf3Z8geBiwCksbQ-Jpzg9OaxPv6VxDJRDkWCE5S2kabhmF4=@gpb.moe> <5b7ac8bb-6f88-a7e2-ac7e-f57b0970a5ba@php.net> Content-Language: en-GB In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit From: php@beccati.com (Matteo Beccati) Hi, Il 03/05/2024 17:53, Hans Henrik Bergan ha scritto: > On Fri, 3 May 2024 at 17:49, Derick Rethans wrote: >> >> Which *API* in PHP is 1-indexed? >> >> cheers, >> Derick > > Certainly isn't normal but found 1 (and only 1!): > > $stmt = $pdo->prepare('SELECT name FROM users WHERE id = ?'); > $stmt->bindParam(1, $id); I suppose numbering is derived from external (database) standards. E.g. Postgres uses $1, $2, etc. as parameter placeholders. Also it is in turn is inconsistent with: $stmt = $pdo->prepare('SELECT name FROM users WHERE id = ?'); $stmt->execute([$id]); That said, 0-indexed for the reflection PR seems the best choice to me too. Cheers -- Matteo Beccati Development & Consulting - http://www.beccati.com/