Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:121656 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 3773 invoked from network); 11 Nov 2023 16:49:16 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 11 Nov 2023 16:49:16 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 805A1180087 for ; Sat, 11 Nov 2023 08:49:14 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-ed1-f45.google.com (mail-ed1-f45.google.com [209.85.208.45]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sat, 11 Nov 2023 08:49:14 -0800 (PST) Received: by mail-ed1-f45.google.com with SMTP id 4fb4d7f45d1cf-53dd752685fso4749664a12.3 for ; Sat, 11 Nov 2023 08:49:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699721352; x=1700326152; darn=lists.php.net; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id:from :to:cc:subject:date:message-id:reply-to; bh=4wWdmm0QTweD4VVrDskC7wl4qGUsUUdKI5gM+KCQM4A=; b=bzYtFI6cVwuBeSEb5iJHfoQaB6B/VULDfQBtKoyLMbTFCirdG1qluiw+lOk6D8Nz3b R1CtuEQjBPMxthi6eNhWYCEysMJrygUs27c2KE/i+jBdMHiMCjrzTeiagxCKHChoNmwG t7MeTtbLidk8KTWtbb0duVV+ccPAx42ChFDY7qoHKlXUaGIZ2/rAtPjSyRCZFCcldVL4 PhT8IWI1Y6Fpk2LUarXDd03D/Glm+ug5UArERGdvcD8+KJLBnu08NtSZfPnCLlePju+6 dIUhwRRTKkidUoo8AxnCjaw5E1ziDVb4vvPnZ2Y4nqzCO0OcUY8fz24mUwmL6+6gr1gH 2dNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699721352; x=1700326152; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=4wWdmm0QTweD4VVrDskC7wl4qGUsUUdKI5gM+KCQM4A=; b=L1UbCPMA2nXPrPx54jRVEQn7fMPdb2yt2tInrhwezxU509ing5s3HieYoflS+Pihin nDIOoau5aMaYH1vpaMUYB+Jee65vZ1j43CcufNCiy5xK6eN10/yeM9NJRWzya3lM3UC0 J4ukr57CtZdYJUJpB20qOFOId3G94zrXYYzyj8RLYdc/72iYXrKCfn+ymjVd0QU7nCqN 3V3/NqsRxQzPnLSA4AeamJSrcTQajTPGeXo+4iPxUYK5flZ+DvJXKbppHU9TQz4hOcX8 5TyV1QtsbW/q+O9b8ODWggv1EEMa5Pl8iFGI00xOfAHTen6ZZWwMgmcxWxczQTVF4Mj+ WnQQ== X-Gm-Message-State: AOJu0YzUJIo6dWxhXtQ4jqDMsFkFDqMJB4OeK8qde4T7ObUt3tSsjOEX c3VQnfJOHVhUuzhBXa6uWo+VXouP9Ao= X-Google-Smtp-Source: AGHT+IEftn1YF2+ZV/zln7ThC1aEo9P7fe2c7gM0v6wEFh6rK8Tm2TPvrzJIROmT/QOMDQcLi9r6qA== X-Received: by 2002:aa7:c902:0:b0:53e:158b:586d with SMTP id b2-20020aa7c902000000b0053e158b586dmr1874982edt.21.1699721352483; Sat, 11 Nov 2023 08:49:12 -0800 (PST) Received: from [192.168.0.59] (178-117-137-225.access.telenet.be. [178.117.137.225]) by smtp.gmail.com with ESMTPSA id v22-20020aa7d816000000b00533e915923asm1168741edq.49.2023.11.11.08.49.11 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 11 Nov 2023 08:49:11 -0800 (PST) Message-ID: <8d4ff1f3-c8ac-4471-80fa-b7bfec2cea12@gmail.com> Date: Sat, 11 Nov 2023 17:49:10 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: PHP internals References: <04ba672f-33e1-4aae-aac4-7ad55dbc21de@gmail.com> <722a3c38-fa29-4cff-94e6-f965cec55a11@bastelstu.be> Content-Language: en-US In-Reply-To: <722a3c38-fa29-4cff-94e6-f965cec55a11@bastelstu.be> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] [RFC] [Discussion] Improve callbacks in ext/dom and ext/xsl From: dossche.niels@gmail.com (Niels Dossche) Hi Tim On 11/11/23 16:32, Tim Düsterhus wrote: > Hi > > On 11/7/23 20:32, Niels Dossche wrote: >> I'm opening the discussion for my RFC "Improve callbacks in ext/dom and ext/xsl". >> RFC link: https://wiki.php.net/rfc/improve_callbacks_dom_and_xsl > > Some question that I believe are not answered: > > 1. > > $xpath->registerPhpFunctions([ >   "foo" => ... > ]); > > $xpath->registerPhpFunctions([ >   "foo" => ... > ]); > > Is this an error due to the duplicate definition or will the last 'foo' win? The last 'foo' will win, such that you can override previous definitions. > > 2. > > $xpath->registerPhpFunctions([]); > > Is this an error or a noop? > This is a no-op, just like it is the case in current PHP versions. > 3. > > Would it make sense to deprecate passing a string as "Future Scope"? Simplifying the method signature would also allow to simplify the documentation in the long run and registering a string is trivially fixed by adding square brackets. Maybe, although I personally don't hate it that much. > > In fact looking at the existing documentation at https://www.php.net/manual/en/domxpath.registerphpfunctions.php, what's the difference between 'php:function()' and 'php:functionString()'? The difference is in the returned result. php:functionString() will case the result to a string automatically for you, while php:function() just returns the result as-is. > > Best regards > Tim Düsterhus Kind regards Niels