<?php
class Auto
{
public $test = 'hello';
function testAuto()
{
echo 'echo from test auto';
}
static function testAuto2()
{
echo 'echo from test auto 2 static';
}
}
$superCar = new Auto();
$superCar::testAuto();
Auto::testAuto();
$superCar::testAuto2();
Auto::testAuto2();
Fatal error: Uncaught Error: Non-static method Auto::testAuto() cannot be called statically in /in/b2nWS:22
Stack trace:
#0 {main}
thrown in /in/b2nWS on line 22
Process exited with code 255.
Deprecated: Non-static method Auto::testAuto() should not be called statically in /in/b2nWS on line 22
echo from test auto
Deprecated: Non-static method Auto::testAuto() should not be called statically in /in/b2nWS on line 23
echo from test autoecho from test auto 2 staticecho from test auto 2 static
Output for 7.3.32 - 7.3.33
echo from test autoecho from test autoecho from test auto 2 staticecho from test auto 2 static
Strict Standards: Non-static method Auto::testAuto() should not be called statically in /in/b2nWS on line 22
echo from test auto
Strict Standards: Non-static method Auto::testAuto() should not be called statically in /in/b2nWS on line 23
echo from test autoecho from test auto 2 staticecho from test auto 2 static
Output for 5.1.0 - 5.1.6, 5.2.0 - 5.2.17
Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM in /in/b2nWS on line 22
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_PAAMAYIM_NEKUDOTAYIM in /in/b2nWS on line 22
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/b2nWS on line 6
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/b2nWS on line 6
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/b2nWS on line 6
Process exited with code 255.