PHP Conference Kansai 2025

Voting

: max(six, nine)?
(Example: nine)

The Note You're Voting On

arthur dot techarts at gmail dot com
13 years ago
Example to understand this function and difference with call_user_func:

<?php
class Beer {
const
NAME = 'Beer!';
public static function
printed(){
echo
'static Beer:NAME = '. static::NAME . PHP_EOL;
}
}

class
Ale extends Beer {
const
NAME = 'Ale!';
public static function
printed(){
forward_static_call(array('parent','printed'));
call_user_func(array('parent','printed'));

forward_static_call(array('Beer','printed'));
call_user_func(array('Beer','printed'));
}
}

Ale::printed();
echo
'</pre>';
?>

<< Back to user notes page

To Top