Hi

On 10/14/23 13:54, Niels Dossche wrote:
(a) Call ucfirst(), but not strtoupper()
(b) Call both

You can call both, it's additive.


Okay, for your suggestion (1) the following would work then?

// Register all native PHP functions.
$xpath->registerPHPFunctions(null);

// Register additional callables.
$xpath->registerPHPFunctions([
  'staticMethod' => ClassWith::staticMethod(...),
  'classWithMagicInvoke' => new ClassWithMagicInvoke(),
]);

I would not find that usage to be too unreasonable. Especially since allow-listing *all* of PHP's global functions would be pretty questionable (looking at eval() and all functions with side-effects).

Best regards
Tim Düsterhus

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php

Reply via email to