3v4l.org

run code in 300+ PHP versions simultaneously
<?php function processor(array $callbacks) { // filter by instance clas $callbacks = array_filter(...); // check number of callbacks for custom logic if (count($callbacks) == 1) { return $callbacks(); } // modyfing by a condition if (DEBUG) { $callbacks[] = debug_logger(...); } return compose($callbacks)(); } function processor2(array $callbacks) { // loop with $callbacks[$i] + $result ??? }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ArK2O
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E > > RETURN                                                   1

Function processor:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 10
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 16
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/ArK2O
function name:  processor
number of ops:  23
compiled vars:  !0 = $callbacks
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    6     1        INIT_FCALL                                               'array_filter'
          2        ZEND_CALLABLE_CONVERT                            ~1      
          3        ASSIGN                                                   !0, ~1
    9     4        COUNT                                            ~3      !0
          5        IS_EQUAL                                                 ~3, 1
          6      > JMPZ                                                     ~4, ->10
   10     7    >   INIT_DYNAMIC_CALL                                        !0
          8        DO_FCALL                                      0  $5      
          9      > RETURN                                                   $5
   14    10    >   FETCH_CONSTANT                                   ~6      'DEBUG'
         11      > JMPZ                                                     ~6, ->16
   15    12    >   INIT_FCALL_BY_NAME                                       'debug_logger'
         13        ZEND_CALLABLE_CONVERT                            ~8      
         14        ASSIGN_DIM                                               !0
         15        OP_DATA                                                  ~8
   18    16    >   INIT_FCALL_BY_NAME                                       'compose'
         17        SEND_VAR_EX                                              !0
         18        DO_FCALL                                      0  $9      
         19        INIT_DYNAMIC_CALL                                        $9
         20        DO_FCALL                                      0  $10     
         21      > RETURN                                                   $10
   19    22*     > RETURN                                                   null

End of function processor

Function processor2:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ArK2O
function name:  processor2
number of ops:  2
compiled vars:  !0 = $callbacks
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   RECV                                             !0      
   23     1      > RETURN                                                   null

End of function processor2

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
136.64 ms | 999 KiB | 14 Q