3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array('1', '1a', '2a', '3', '4a'); $array2 = array_map(function($val) { return strpos($val, 'a') ? $val : null; }, $array); var_dump($array2);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/j4O4o
function name:  (null)
number of ops:  11
compiled vars:  !0 = $array, !1 = $array2
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%2Fj4O4o%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                                                 
         10      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2Fj4O4o%3A5%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 8
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/j4O4o
function name:  {closure}
number of ops:  11
compiled vars:  !0 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        INIT_FCALL                                               'strpos'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 'a'
          4        DO_ICALL                                         $1      
          5      > JMPZ                                                     $1, ->8
          6    >   QM_ASSIGN                                        ~2      !0
          7      > JMP                                                      ->9
          8    >   QM_ASSIGN                                        ~2      null
          9    > > RETURN                                                   ~2
         10*     > RETURN                                                   null

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.97 ms | 1387 KiB | 19 Q