3v4l.org

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

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

End of function %00%7Bclosure%7D%2Fin%2Fm9fRL%3A4%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
191.73 ms | 1396 KiB | 17 Q