3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types = 1); namespace aaa; class Foo { public function sayHello(): void { $expectedDaysResult = [ '2019-01-04' => [ '17:00', 'evening', ], '2019-01-05' => [ '07:00', 'morning', ], '2019-01-06' => [ '12:00', 'afternoon', ], '2019-01-07' => [ '10:00', '11:00', '12:00', '13:00', '14:00', '15:00', '16:00', '17:00', 'morning', 'afternoon', 'evening', ], '2019-01-08' => [ '07:00', '08:00', '13:00', '19:00', 'morning', 'afternoon', 'evening', ], 'anyDay' => [ '07:00', '08:00', '10:00', '11:00', '12:00', '13:00', '14:00', '15:00', '16:00', '17:00', '19:00', 'morning', 'afternoon', 'evening', ], ]; $actualEnabledDays = $this->getEnabledDays(); assert(count($expectedDaysResult) === $actualEnabledDays); \PHPStan\dumpType($actualEnabledDays); } /** * @return array<string, array<int, string>> */ private function getEnabledDays(): array { return []; } } (new Foo())->sayHello();
Output for 8.1.32, 8.2.0 - 8.2.29, 8.3.0 - 8.3.26, 8.4.1 - 8.4.13
Fatal error: Uncaught AssertionError: assert(count($expectedDaysResult) === $actualEnabledDays) in /in/k2LU5:63 Stack trace: #0 /in/k2LU5(63): assert(false, 'assert(count($e...') #1 /in/k2LU5(76): aaa\Foo->sayHello() #2 {main} thrown in /in/k2LU5 on line 63
Process exited with code 255.

preferences:
60.91 ms | 406 KiB | 5 Q