3v4l.org

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

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

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.58 ms | 1396 KiB | 17 Q