Results: 1022
Guitar implements IMusician interface
interface IMusician {
    public function play();
}

class Guitarist implements IMusician {
    public function play() { 
        echo "playin a guitar";
    }
}
In this example
Guitarist
child class has to define
play()
method because the child class implements interface
IMusician
that has the method signature
In this example,
.logout
item will grow twice as quick as
.home
item
.home {
    flex-grow: 1;
}
.logout{
    flex-grow: 2;
}
pseudo-element "first-letter"
We can style The first letter of the paragraph differently
p::first-letter {
    color: blue;  
    font-size: 20px;  
    font-weight: bold;  
    background-color: yellow;
}
1.
json_decode
returns an instance of
stdClass
class
$json = '{ "foo": "bar", "number": 42 }';
$stdInstance = json_decode($json);


//Example with StdClass
echo get_class($stdInstance) . ':' . PHP_EOL;
echo $stdInstance->foo . PHP_EOL; //"bar"
echo $stdInstance->number . PHP_EOL . PHP_EOL;


//Example with associative array
echo 'associative array:' . PHP_EOL;
$array = json_decode($json, true);
echo $array['foo'] . PHP_EOL; //"bar"
echo $array['number'] . PHP_EOL; //42
2. Casting an array to an object returns an instance of
stdClass
class
$array = array(
    'Property1'=>'hello',
    'Property2'=>'world',
    'Property3'=>'again',
);

$obj = (object) $array;
echo get_class($obj) . ':' . PHP_EOL;
echo $obj->Property3;
User details info represented using an array and an object
$array_user = array();
$array_user["name"] = "smith john";
$array_user["username"] = "smith";
$array_user["id"] = "1002";
$array_user["email"] = "smith@nomail.com";

$obj_user = new stdClass;
$obj_user->name = "smith john";
$obj_user->username = "smith";
$obj_user->id = "1002";
$obj_user->email = "smith@nomail.com";
Returns false if the email is not in a correct format (if the email is not valid)
if (filter_var($email, FILTER_VALIDATE_EMAIL)) {
    $this->addError('email', 'email must be a valid email');
}
pseudo-element "first-line"
We can style the first line of the paragraph text differently
p::first-line {
    color: blue;
    font-size: 20px;
    font-weight: bold;
    background-color: yellow;
}
We can make CSS selector more specific using attribute's certain value
.my-form input[type="text"]{
    padding: 8px;
    width: 100%;
}
In this example, only inputs will be selected with types
text
Creates three equal-width columns on small, medium, large, and extra large devices
<div class="container">
  <div class="row">
    <div class="col-sm">
      One of three columns
    </div>
    <div class="col-sm">
      One of three columns
    </div>
    <div class="col-sm">
      One of three columns
    </div>
  </div>
</div>
If there is no constructor in child class, then parent class constructor will be called (when appropriate parameters are passed)
class BaseClass {
    function __construct() {
        print "In BaseClass constructor\n";
    }
}

class SubClass extends BaseClass {
    function __construct() {
        parent::__construct();
        print "In SubClass constructor\n";
    }
}

class OtherSubClass extends BaseClass {
    // inherits BaseClass's constructor
}

// In BaseClass constructor
$obj = new BaseClass();

// In BaseClass constructor
// In SubClass constructor
$obj = new SubClass();

// In BaseClass constructor
$obj = new OtherSubClass();
The replaced content is sized to maintain its aspect ratio while filling the element's entire content box. The object will be clipped to fit.
Results: 1022