<?php
class Lang
{
protected $locale;
public function __construct()
{
$this->locale = 'nl';
}
public function get($testArg)
{
return 'Here is your locale: ' . $testArg . ',' . $this->locale;
}
public static function __callStatic($name, $arguments)
{
return call_user_func_array([new Lang(), $name], $arguments);
}
}
echo Lang::get('testest');
Fatal error: Uncaught Error: Non-static method Lang::get() cannot be called statically in /in/lENdZ:24
Stack trace:
#0 {main}
thrown in /in/lENdZ on line 24
Process exited with code 255.
Deprecated: Non-static method Lang::get() should not be called statically in /in/lENdZ on line 24
Fatal error: Uncaught Error: Using $this when not in object context in /in/lENdZ:15
Stack trace:
#0 /in/lENdZ(24): Lang::get('testest')
#1 {main}
thrown in /in/lENdZ 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/lENdZ:15
Stack trace:
#0 /in/lENdZ(24): Lang::get('testest')
#1 {main}
thrown in /in/lENdZ on line 15
Process exited with code 255.
Strict Standards: Non-static method Lang::get() should not be called statically in /in/lENdZ on line 24
Fatal error: Using $this when not in object context in /in/lENdZ on line 15
Process exited with code 255.
Parse error: syntax error, unexpected '[', expecting ')' in /in/lENdZ on line 20
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Parse error: parse error, unexpected '[', expecting ')' in /in/lENdZ on line 20
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/lENdZ on line 5
Process exited with code 255.
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/lENdZ on line 5
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/lENdZ on line 5
Process exited with code 255.