3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ null, null, null, 1, null, ]; var_export(($fn = function($array) use (&$fn) { return array_shift($array) ?? ($array ? $fn($array) : null); })($array));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5Z1vN
function name:  (null)
number of ops:  11
compiled vars:  !0 = $array, !1 = $fn
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   11     1        INIT_FCALL                                               'var_export'
          2        DECLARE_LAMBDA_FUNCTION                          ~3      [0]
          3        BIND_LEXICAL                                             ~3, !1
          4        ASSIGN                                           ~4      !1, ~3
          5        INIT_DYNAMIC_CALL                                        ~4
          6        SEND_VAR_EX                                              !0
          7        DO_FCALL                                      0  $5      
          8        SEND_VAR                                                 $5
          9        DO_ICALL                                                 
         10      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 12
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5Z1vN
function name:  {closure}
number of ops:  16
compiled vars:  !0 = $array, !1 = $fn
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
          0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
          2        INIT_FCALL                                               'array_shift'
          3        SEND_REF                                                 !0
          4        DO_ICALL                                         $2      
          5        COALESCE                                         ~3      $2
          6      > JMPZ                                                     !0, ->12
          7    >   INIT_DYNAMIC_CALL                                        !1
          8        SEND_VAR_EX                                              !0
          9        DO_FCALL                                      0  $4      
         10        QM_ASSIGN                                        ~5      $4
         11      > JMP                                                      ->13
         12    >   QM_ASSIGN                                        ~5      null
         13    >   QM_ASSIGN                                        ~3      ~5
         14      > RETURN                                                   ~3
         15*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.43 ms | 1007 KiB | 15 Q