3v4l.org

run code in 500+ PHP versions simultaneously
<?php class QueryBuilder { public function updateBatch($set = null, ?string $index = null, int $batchSize = 100) {} } class MyQB extends QueryBuilder { public function updateBatch(?array $set = null, ?string $index = null, int $batchSize = 100) {} }
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.34, 8.2.0 - 8.2.36, 8.3.0 - 8.3.5
Fatal error: Declaration of MyQB::updateBatch(?array $set = null, ?string $index = null, int $batchSize = 100) must be compatible with QueryBuilder::updateBatch($set = null, ?string $index = null, int $batchSize = 100) in /in/oIIBP on line 9
Process exited with code 255.
Output for 7.4.0 - 7.4.24
Warning: Declaration of MyQB::updateBatch(?array $set = NULL, ?string $index = NULL, int $batchSize = 100) should be compatible with QueryBuilder::updateBatch($set = NULL, ?string $index = NULL, int $batchSize = 100) in /in/oIIBP on line 9
Output for 7.3.0 - 7.3.31
Warning: Declaration of MyQB::updateBatch(?array $set = NULL, ?string $index = NULL, int $batchSize = 100) should be compatible with QueryBuilder::updateBatch($set = NULL, ?string $index = NULL, int $batchSize = 100) in /in/oIIBP on line 11

preferences:
32.84 ms | 1170 KiB | 5 Q