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();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/k2LU5
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   76     0  E >   NEW                                              $0      'aaa%5CFoo'
          1        DO_FCALL                                      0          
          2        INIT_METHOD_CALL                                         $0, 'sayHello'
          3        DO_FCALL                                      0          
          4      > RETURN                                                   1

Class aaa\Foo:
Function sayhello:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/k2LU5
function name:  sayHello
number of ops:  17
compiled vars:  !0 = $expectedDaysResult, !1 = $actualEnabledDays
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   ASSIGN                                                   !0, <array>
   62     1        INIT_METHOD_CALL                                         'getEnabledDays'
          2        DO_FCALL                                      0  $3      
          3        ASSIGN                                                   !1, $3
   63     4        ASSERT_CHECK                                             
          5        INIT_NS_FCALL_BY_NAME                                    'aaa%5Cassert'
          6        INIT_NS_FCALL_BY_NAME                                    'aaa%5Ccount'
          7        SEND_VAR_EX                                              !0
          8        DO_FCALL                                      0  $5      
          9        IS_IDENTICAL                                     ~6      !1, $5
         10        SEND_VAL_EX                                              ~6
         11        SEND_VAL_EX                                              'assert%28count%28%24expectedDaysResult%29+%3D%3D%3D+%24actualEnabledDays%29'
         12        DO_FCALL                                      0          
   64    13        INIT_FCALL_BY_NAME                                       'PHPStan%5CdumpType'
         14        SEND_VAR_EX                                              !1
         15        DO_FCALL                                      0          
   65    16      > RETURN                                                   null

End of function sayhello

Function getenableddays:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/k2LU5
function name:  getEnabledDays
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   72     0  E > > RETURN                                                   <array>
   73     1*       VERIFY_RETURN_TYPE                                       
          2*     > RETURN                                                   null

End of function getenableddays

End of class aaa\Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143 ms | 1002 KiB | 15 Q