Example #1
0
<?php

class Cars
{
    public $wheels = 4;
    static $doors = 4;
    static function greetings()
    {
        echo 'hello';
        echo Cars::$wheels;
    }
}
$bmw = new Cars();
$bmw->wheels;
//calling the static property_exists
echo Cars::$doors;
//calling a static method
Cars::greetings();