3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); function void(): void { } function handleBatch(iterable $commands, ?callable $onEach = null): void { $onEach ??= 'void'; foreach ($commands as $command) { // handle $command $onEach($command); } } handleBatch([new \stdClass()]);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LGpZP
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   INIT_FCALL                                               'handlebatch'
          1        NEW                                              $0      'stdClass'
          2        DO_FCALL                                      0          
          3        INIT_ARRAY                                       ~2      $0
          4        SEND_VAL                                                 ~2
          5        DO_FCALL                                      0          
          6      > RETURN                                                   1

Function void:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LGpZP
function name:  void
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E > > RETURN                                                   null

End of function void

Function handlebatch:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 12
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 12
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/LGpZP
function name:  handleBatch
number of ops:  14
compiled vars:  !0 = $commands, !1 = $onEach, !2 = $command
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      null
   11     2        COALESCE                                         ~3      !1
          3        ASSIGN                                           ~4      !1, 'void'
          4        QM_ASSIGN                                        ~3      ~4
          5        FREE                                                     ~3
   13     6      > FE_RESET_R                                       $5      !0, ->12
          7    > > FE_FETCH_R                                               $5, !2, ->12
   15     8    >   INIT_DYNAMIC_CALL                                        !1
          9        SEND_VAR_EX                                              !2
         10        DO_FCALL                                      0          
   13    11      > JMP                                                      ->7
         12    >   FE_FREE                                                  $5
   17    13      > RETURN                                                   null

End of function handlebatch

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.14 ms | 999 KiB | 14 Q