Skip to content

Latest commit

 

History

History
19 lines (14 loc) · 280 Bytes

PropertyTypeCoercion.md

File metadata and controls

19 lines (14 loc) · 280 Bytes

PropertyTypeCoercion

Emitted when setting a property with a value which has a less specific type than the property expects

<?php

class A {}
class B extends A {}

function takesA(C $c, A $a) : void {
    $c->b = $a;
}

class C {
    /** @var ?B */
    public $b;
}