3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ 'PHP', 'Arrays', 'Funções', ]; function hashtag($x){ return "#".$x; } $y = array_map(function ($v, $k){ return "#".$v.$k; }, $array); print_r($y);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/98hLS
function name:  (null)
number of ops:  11
compiled vars:  !0 = $array, !1 = $y
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   12     1        INIT_FCALL                                               'array_map'
          2        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F98hLS%3A12%240'
   14     3        SEND_VAL                                                 ~3
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $4      
   12     6        ASSIGN                                                   !1, $4
   16     7        INIT_FCALL                                               'print_r'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Function hashtag:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/98hLS
function name:  hashtag
number of ops:  4
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
    9     1        CONCAT                                           ~1      '%23', !0
          2      > RETURN                                                   ~1
   10     3*     > RETURN                                                   null

End of function hashtag

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

End of function %00%7Bclosure%7D%2Fin%2F98hLS%3A12%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
206.02 ms | 1395 KiB | 17 Q