Voting

: min(three, four)?
(Example: nine)

The Note You're Voting On

sskaje at gmail dot com
9 years ago
static::class and self::class can be used to get current class name,
work under 5.5 and 5.6
failed in 5.3.

<?php
class a{
function
d() {
echo
"=== self::class ===\n";
var_dump(self::class);
echo
"=== static::class ===\n";
var_dump(static::class);
}
}
class
b extends a{}
class
c extends b{}

a::d();
b::d();
c::d();

/*
Output:

=== self::class ===
string(1) "a"
=== static::class ===
string(1) "a"
=== self::class ===
string(1) "a"
=== static::class ===
string(1) "b"
=== self::class ===
string(1) "a"
=== static::class ===
string(1) "c"

*/

<< Back to user notes page

To Top