<?php
function bar(callable $fn)
{
echo "It passed a callable check\n";
@$fn();
}
class foo
{
protected $a;
function bar()
{
$this->a;
echo "oh dear lord, this is an instance function";
}
}
$foo = new foo;
foo::bar();
@bar(['foo', 'bar']);
Fatal error: Uncaught Error: Non-static method foo::bar() cannot be called statically in /in/UevBS:22
Stack trace:
#0 {main}
thrown in /in/UevBS on line 22
Process exited with code 255.
Deprecated: Non-static method foo::bar() should not be called statically in /in/UevBS on line 22
Fatal error: Uncaught Error: Using $this when not in object context in /in/UevBS:15
Stack trace:
#0 /in/UevBS(22): foo::bar()
#1 {main}
thrown in /in/UevBS on line 15
Process exited with code 255.
Output for 7.3.32 - 7.3.33
Fatal error: Uncaught Error: Using $this when not in object context in /in/UevBS:15
Stack trace:
#0 /in/UevBS(22): foo::bar()
#1 {main}
thrown in /in/UevBS on line 15
Process exited with code 255.
Strict Standards: Non-static method foo::bar() should not be called statically in /in/UevBS on line 22
Fatal error: Using $this when not in object context in /in/UevBS on line 15
Process exited with code 255.