3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = array( 'position' => 'it', 'label' => 'Information Technology' ); $data = array_map(function($a) { global $data; if ('position' == array_search($a, $data)) { return strtoupper($a); } else { return $a; } }, $data); print_r($data);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TiXNa
function name:  (null)
number of ops:  11
compiled vars:  !0 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    8     1        INIT_FCALL                                               'array_map'
          2        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FTiXNa%3A8%240'
   13     3        SEND_VAL                                                 ~2
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $3      
    8     6        ASSIGN                                                   !0, $3
   15     7        INIT_FCALL                                               'print_r'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FTiXNa%3A8%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 13
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TiXNa
function name:  {closure}
number of ops:  15
compiled vars:  !0 = $a, !1 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
    9     1        BIND_GLOBAL                                              !1, 'data'
   10     2        INIT_FCALL                                               'array_search'
          3        SEND_VAR                                                 !0
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                         $2      
          6        IS_EQUAL                                                 $2, 'position'
          7      > JMPZ                                                     ~3, ->13
   11     8    >   INIT_FCALL                                               'strtoupper'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                         $4      
         11      > RETURN                                                   $4
         12*       JMP                                                      ->14
   12    13    > > RETURN                                                   !0
   13    14*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FTiXNa%3A8%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.58 ms | 1396 KiB | 21 Q