<?php
class foo
{
public function getUserEntityClass()
{
return 'apa';
}
}
class apa
{
public function bar()
{
echo "is here";
}
}
var_dump((new foo())->getUserEntityClass());
//$test = new ());
$test->bar();
string(3) "apa"
Warning: Undefined variable $test in /in/narHt on line 22
Fatal error: Uncaught Error: Call to a member function bar() on null in /in/narHt:22
Stack trace:
#0 {main}
thrown in /in/narHt on line 22
Process exited with code 255.
string(3) "apa"
Notice: Undefined variable: test in /in/narHt on line 22
Fatal error: Uncaught Error: Call to a member function bar() on null in /in/narHt:22
Stack trace:
#0 {main}
thrown in /in/narHt on line 22
Process exited with code 255.
Output for 7.3.32 - 7.3.33
string(3) "apa"
Fatal error: Uncaught Error: Call to a member function bar() on null in /in/narHt:22
Stack trace:
#0 {main}
thrown in /in/narHt on line 22
Process exited with code 255.
Output for 7.0.0 - 7.0.4
string(3) "apa"
Notice: Undefined variable: test in /in/narHt on line 22
Fatal error: Uncaught Error: Call to a member function bar() on unknown in /in/narHt:22
Stack trace:
#0 {main}
thrown in /in/narHt on line 22
Process exited with code 255.
Output for 5.6.7 - 5.6.28
string(3) "apa"
Notice: Undefined variable: test in /in/narHt on line 22
Fatal error: Call to a member function bar() on null in /in/narHt on line 22
Process exited with code 255.
Output for 5.4.0 - 5.4.45, 5.5.24 - 5.5.35
string(3) "apa"
Notice: Undefined variable: test in /in/narHt on line 22
Fatal error: Call to a member function bar() on a non-object in /in/narHt on line 22
Process exited with code 255.
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /in/narHt on line 19
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_OBJECT_OPERATOR in /in/narHt on line 19
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/narHt 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/narHt 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/narHt on line 5
Process exited with code 255.