3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = [1, 2, 3]; $b = array_map(function ($_) { if ($_ === 1) return 4; }, $a); var_dump($b); var_dump(array_filter($b));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8JqkC
function name:  (null)
number of ops:  17
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        INIT_FCALL                                               'array_map'
          2        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F8JqkC%3A5%240'
          3        SEND_VAL                                                 ~3
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $4      
          6        ASSIGN                                                   !1, $4
    7     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                                 
    8    10        INIT_FCALL                                               'var_dump'
         11        INIT_FCALL                                               'array_filter'
         12        SEND_VAR                                                 !1
         13        DO_ICALL                                         $7      
         14        SEND_VAR                                                 $7
         15        DO_ICALL                                                 
         16      > RETURN                                                   1

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

End of function %00%7Bclosure%7D%2Fin%2F8JqkC%3A5%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.8 ms | 1395 KiB | 19 Q