3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ [ 'a' => '', 'b' => [ 'x' => '' ], 'c' => [ 'y'=> [ '1' => '' ] ], 'd' => '' ] ]; function empty_r(array $array): bool { foreach ($array as $v) { if (is_array($v) ? !empty_r($v) : $v) { return false; } } return true; } var_export(empty_r($array));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2Skob
function name:  (null)
number of ops:  8
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   28     1        INIT_FCALL                                               'var_export'
          2        INIT_FCALL                                               'empty_r'
          3        SEND_VAR                                                 !0
          4        DO_FCALL                                      0  $2      
          5        SEND_VAR                                                 $2
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

Function empty_r:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 16
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 16
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 11
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 15
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 15
Branch analysis from position: 13
Branch analysis from position: 15
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/2Skob
function name:  empty_r
number of ops:  20
compiled vars:  !0 = $array, !1 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   RECV                                             !0      
   20     1      > FE_RESET_R                                       $2      !0, ->16
          2    > > FE_FETCH_R                                               $2, !1, ->16
   21     3    >   TYPE_CHECK                                  128          !1
          4      > JMPZ                                                     ~3, ->11
          5    >   INIT_FCALL_BY_NAME                                       'empty_r'
          6        SEND_VAR_EX                                              !1
          7        DO_FCALL                                      0  $4      
          8        BOOL_NOT                                         ~5      $4
          9        QM_ASSIGN                                        ~6      ~5
         10      > JMP                                                      ->12
         11    >   QM_ASSIGN                                        ~6      !1
         12    > > JMPZ                                                     ~6, ->15
   22    13    >   FE_FREE                                                  $2
         14      > RETURN                                                   <false>
   20    15    > > JMP                                                      ->2
         16    >   FE_FREE                                                  $2
   25    17      > RETURN                                                   <true>
   26    18*       VERIFY_RETURN_TYPE                                       
         19*     > RETURN                                                   null

End of function empty_r

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
136.42 ms | 1003 KiB | 15 Q