<?php
class A {
public function __construct(string $a)
{
}
public function test( $who )
{
echo "\n".$who." ebal!";
}
}
class B extends A {
public function __construct(int $z, int $y)
{
parent::__construct($z . $y);
}
public function test( $who )
{
parent::test( $who." tvoyu" );
}
}
$b = new B(1, 2);
$b->test( 'Mamka' );
Catchable fatal error: Argument 1 passed to B::__construct() must be an instance of int, integer given, called in /in/MpSH5 on line 26 and defined in /in/MpSH5 on line 15
Process exited with code 255.