php 7 return types and overriding an interface

interface IA { public function func1() : bool ; } class A implements IA { public function func1() : bool { //echo 'this is func1 override from IA'; return "this is string"; } } $objA = new A; echo($objA->func1()); interface IA { public function func1() : bool ; } class A implements IA { public function func1() : string { //echo 'this is func1 override from IA'; return "this is string"; } } $objA = new A; echo($objA->func1()); declare(strict_types=1) ?...

January 20, 2016 · 1 min · longka