- Output for 8.2.0 - 8.2.26, 8.3.0 - 8.3.14, 8.4.1
- x::foox::barx::bar
- Output for 4.3.0
- Parse error: parse error, unexpected T_STATIC, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/NsId6 on line 5
Process exited with code 255.
<?php
class x {
function foo($a = 1) { echo __METHOD__;}
static function bar($a = 1) { echo __METHOD__;}
}
$x = new x();
$x->foo(); // classic method call
$x::bar(); // static method call on object
X::bar(); // static method call on class name
?>