Dynamic Static Calls
PHP
2024-11-18
17
PHP now allows dynamic calls to static methods
<?php
class
helper
{
static function
foo
() {
echo
__METHOD__
;
}
}
$a
=
"helper"
;
$b
=
"foo"
;
$a
::
$b
();
?>
Output
helper::foo