3v4l.org

run code in 300+ PHP versions simultaneously
<?php $foo = array_map(fn($string) => $string . '!', ['hello', 'goodbye']); var_dump($foo); $foo = array_map(fn($string, $suffix) => $string . $suffix, ['one', 'two'], [' - uno', ' - dos']); var_dump($foo); $foo = array_map(fn($english, $spanish) => "'$english' en EspaƱol es '$spanish'", ['one', 'two'], ['uno', 'dos']); var_dump($foo); $foo = array_map(fn($english, $spanish, $german) => "$english - $spanish - $german", ['one', 'two'], ['uno', 'dos'], ['ein', 'zwei']); var_dump($foo);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/d55kT
function name:  (null)
number of ops:  41
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'array_map'
          1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fd55kT%3A3%240'
          2        SEND_VAL                                                 ~1
          3        SEND_VAL                                                 <array>
          4        DO_ICALL                                         $2      
          5        ASSIGN                                                   !0, $2
    4     6        INIT_FCALL                                               'var_dump'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                                 
    6     9        INIT_FCALL                                               'array_map'
         10        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fd55kT%3A6%241'
         11        SEND_VAL                                                 ~5
         12        SEND_VAL                                                 <array>
         13        SEND_VAL                                                 <array>
         14        DO_ICALL                                         $6      
         15        ASSIGN                                                   !0, $6
    7    16        INIT_FCALL                                               'var_dump'
         17        SEND_VAR                                                 !0
         18        DO_ICALL                                                 
    9    19        INIT_FCALL                                               'array_map'
         20        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fd55kT%3A9%242'
         21        SEND_VAL                                                 ~9
         22        SEND_VAL                                                 <array>
         23        SEND_VAL                                                 <array>
         24        DO_ICALL                                         $10     
         25        ASSIGN                                                   !0, $10
   10    26        INIT_FCALL                                               'var_dump'
         27        SEND_VAR                                                 !0
         28        DO_ICALL                                                 
   12    29        INIT_FCALL                                               'array_map'
         30        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fd55kT%3A12%243'
         31        SEND_VAL                                                 ~13
         32        SEND_VAL                                                 <array>
         33        SEND_VAL                                                 <array>
         34        SEND_VAL                                                 <array>
         35        DO_ICALL                                         $14     
         36        ASSIGN                                                   !0, $14
   13    37        INIT_FCALL                                               'var_dump'
         38        SEND_VAR                                                 !0
         39        DO_ICALL                                                 
         40      > RETURN                                                   1

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

End of function %00%7Bclosure%7D%2Fin%2Fd55kT%3A3%240

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

End of function %00%7Bclosure%7D%2Fin%2Fd55kT%3A6%241

Function %00%7Bclosure%7D%2Fin%2Fd55kT%3A9%242:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/d55kT
function name:  {closure}
number of ops:  9
compiled vars:  !0 = $english, !1 = $spanish
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        ROPE_INIT                                     5  ~3      '%27'
          3        ROPE_ADD                                      1  ~3      ~3, !0
          4        ROPE_ADD                                      2  ~3      ~3, '%27+en+Espa%C3%B1ol+es+%27'
          5        ROPE_ADD                                      3  ~3      ~3, !1
          6        ROPE_END                                      4  ~2      ~3, '%27'
          7      > RETURN                                                   ~2
          8*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2Fd55kT%3A9%242

Function %00%7Bclosure%7D%2Fin%2Fd55kT%3A12%243:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/d55kT
function name:  {closure}
number of ops:  10
compiled vars:  !0 = $english, !1 = $spanish, !2 = $german
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        ROPE_INIT                                     5  ~4      !0
          4        ROPE_ADD                                      1  ~4      ~4, '+-+'
          5        ROPE_ADD                                      2  ~4      ~4, !1
          6        ROPE_ADD                                      3  ~4      ~4, '+-+'
          7        ROPE_END                                      4  ~3      ~4, !2
          8      > RETURN                                                   ~3
          9*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2Fd55kT%3A12%243

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
127.88 ms | 1405 KiB | 17 Q