3v4l.org

run code in 300+ PHP versions simultaneously
<?php var_dump(array_reduce([1, null, null, 2, null], function($carry, $item) { if(empty($item)) { $carry++; } return $carry; }, 0));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/npOKu
function name:  (null)
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'array_reduce'
          2        SEND_VAL                                                 <array>
          3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FnpOKu%3A2%240'
   11     4        SEND_VAL                                                 ~0
          5        SEND_VAL                                                 0
          6        DO_ICALL                                         $1      
          7        SEND_VAR                                                 $1
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

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

End of function %00%7Bclosure%7D%2Fin%2FnpOKu%3A2%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
205.68 ms | 1395 KiB | 17 Q