I just wrote a sample class to better understand the static methods and variables in PHP. I understand how the static variables work but the static function is not working as expected. If you see the below code
class Car{
static $wheels=4;
static function getWheels(){
echo Car::$wheels=10;
}
}
$car1 = new Car();
$car1->getWheels();
I was expecting
$car1->getWheels(); to throw and error since getWheels is a static method.
Why is this not throwing an error or warning?