3v4l.org

run code in 300+ PHP versions simultaneously
<?php $pattern = [ 'child' => function($age) { return $age < 13; }, 'teen' => function($age) { return $age > 12 && $age < 20; }, 'adult' => function($age) { return $age > 20; } ]; $routines = [ 'child' => function($name) { return 'Hello little '.$name; }, 'teen' => function($name) { return $name.', bro, U fine?'; }, 'adult' => function($age) { return 'Good morning Mr. '.$name; } ]; var_dump(array_map(null, $pattern, $routines));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YSv04
function name:  (null)
number of ops:  23
compiled vars:  !0 = $pattern, !1 = $routines
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FYSv04%3A4%240'
    6     1        INIT_ARRAY                                       ~3      ~2, 'child'
    7     2        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FYSv04%3A7%241'
    9     3        ADD_ARRAY_ELEMENT                                ~3      ~4, 'teen'
   10     4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FYSv04%3A10%242'
   12     5        ADD_ARRAY_ELEMENT                                ~3      ~5, 'adult'
    3     6        ASSIGN                                                   !0, ~3
   16     7        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FYSv04%3A16%243'
   18     8        INIT_ARRAY                                       ~8      ~7, 'child'
   19     9        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FYSv04%3A19%244'
   21    10        ADD_ARRAY_ELEMENT                                ~8      ~9, 'teen'
   22    11        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FYSv04%3A22%245'
   24    12        ADD_ARRAY_ELEMENT                                ~8      ~10, 'adult'
   15    13        ASSIGN                                                   !1, ~8
   27    14        INIT_FCALL                                               'var_dump'
         15        INIT_FCALL                                               'array_map'
         16        SEND_VAL                                                 null
         17        SEND_VAR                                                 !0
         18        SEND_VAR                                                 !1
         19        DO_ICALL                                         $12     
         20        SEND_VAR                                                 $12
         21        DO_ICALL                                                 
         22      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FYSv04%3A4%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YSv04
function name:  {closure}
number of ops:  4
compiled vars:  !0 = $age
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1        IS_SMALLER                                       ~1      !0, 13
          2      > RETURN                                                   ~1
    6     3*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FYSv04%3A4%240

Function %00%7Bclosure%7D%2Fin%2FYSv04%3A7%241:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 3, Position 2 = 5
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
filename:       /in/YSv04
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $age
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    8     1        IS_SMALLER                                       ~1      12, !0
          2      > JMPZ_EX                                          ~1      ~1, ->5
          3    >   IS_SMALLER                                       ~2      !0, 20
          4        BOOL                                             ~1      ~2
          5    > > RETURN                                                   ~1
    9     6*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FYSv04%3A7%241

Function %00%7Bclosure%7D%2Fin%2FYSv04%3A10%242:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YSv04
function name:  {closure}
number of ops:  4
compiled vars:  !0 = $age
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
   11     1        IS_SMALLER                                       ~1      20, !0
          2      > RETURN                                                   ~1
   12     3*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FYSv04%3A10%242

Function %00%7Bclosure%7D%2Fin%2FYSv04%3A16%243:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YSv04
function name:  {closure}
number of ops:  4
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   RECV                                             !0      
   17     1        CONCAT                                           ~1      'Hello+little+', !0
          2      > RETURN                                                   ~1
   18     3*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FYSv04%3A16%243

Function %00%7Bclosure%7D%2Fin%2FYSv04%3A19%244:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YSv04
function name:  {closure}
number of ops:  4
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   RECV                                             !0      
   20     1        CONCAT                                           ~1      !0, '%2C+bro%2C+U+fine%3F'
          2      > RETURN                                                   ~1
   21     3*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FYSv04%3A19%244

Function %00%7Bclosure%7D%2Fin%2FYSv04%3A22%245:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YSv04
function name:  {closure}
number of ops:  4
compiled vars:  !0 = $age, !1 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   RECV                                             !0      
   23     1        CONCAT                                           ~2      'Good+morning+Mr.+', !1
          2      > RETURN                                                   ~2
   24     3*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FYSv04%3A22%245

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.38 ms | 1400 KiB | 17 Q