<?php
class Example {
static $count;
function __construct() {
$this->count++;
}
function getCount() {
return $this->count;
}
}
$instance = new Example();
echo $instance->getCount();
?>
Notice: Accessing static property Example::$count as non static in /in/mW024 on line 9
Deprecated: Creation of dynamic property Example::$count is deprecated in /in/mW024 on line 9
Warning: Undefined property: Example::$count in /in/mW024 on line 9
Notice: Accessing static property Example::$count as non static in /in/mW024 on line 15
1
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.27
Notice: Accessing static property Example::$count as non static in /in/mW024 on line 9
Warning: Undefined property: Example::$count in /in/mW024 on line 9
Notice: Accessing static property Example::$count as non static in /in/mW024 on line 15
1
Notice: Accessing static property Example::$count as non static in /in/mW024 on line 9
Notice: Undefined property: Example::$count in /in/mW024 on line 9
Notice: Accessing static property Example::$count as non static in /in/mW024 on line 15
1
Output for 5.0.0 - 5.0.4, 7.3.32 - 7.3.33
1
Output for 5.5.0 - 5.5.38, 5.6.0 - 5.6.28
Strict Standards: Accessing static property Example::$count as non static in /in/mW024 on line 9
Notice: Undefined property: Example::$count in /in/mW024 on line 9
Strict Standards: Accessing static property Example::$count as non static in /in/mW024 on line 15
1
Strict Standards: Accessing static property Example::$count as non static in /in/mW024 on line 9
Strict Standards: Accessing static property Example::$count as non static in /in/mW024 on line 15
1
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STATIC, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/mW024 on line 5
Process exited with code 255.
Parse error: parse error, unexpected T_STATIC, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/mW024 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/mW024 on line 5
Process exited with code 255.