- Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.7
- Fatal error: Declaration of B::query(): int must be compatible with A::query(): array in /in/EoXf6 on line 13
Process exited with code 255.
<?php
class A {
public function query(): array {
return [];
}
}
class B extends A {
public function query(): int {
return 0;
}
}
$o = new B;
var_dump($o->query());