PHP 8.5.0 Alpha 1 available for testing

Voting

: three plus six?
(Example: nine)

The Note You're Voting On

kx
16 years ago
At least as of PHP 5.3.0a2 there's a function get_called_class(), which returns the class on which the static method is called.

<?php

class a {
static public function
test() {
print
get_called_class();
}
}

class
b extends a {
}

a::test(); // "a"
b::test(); // "b"

?>

<< Back to user notes page

To Top