3v4l.org

run code in 300+ PHP versions simultaneously
<?php function ds($dir) { try { $s = 0; foreach ($fs = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($dir)) as $f) { try { $s += $f->getSize(); } catch (UnexpectedValueException $e) { return $s; } } return b($s); } catch (UnexpectedValueException $e) { return 'xxxx'; } catch (RuntimeException $e) { return 'xxxx'; } } echo print_r(ds(__DIRECTORY__));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TdNS3
function name:  (null)
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_FCALL                                               'print_r'
          1        INIT_FCALL                                               'ds'
          2        FETCH_CONSTANT                                   ~0      '__DIRECTORY__'
          3        SEND_VAL                                                 ~0
          4        DO_FCALL                                      0  $1      
          5        SEND_VAR                                                 $1
          6        DO_ICALL                                         $2      
          7        ECHO                                                     $2
          8      > RETURN                                                   1

Function ds:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 19
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 19
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
Found catch point at position: 15
Branch analysis from position: 15
2 jumps found. (Code = 107) Position 1 = 16, Position 2 = -2
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 25
Branch analysis from position: 25
2 jumps found. (Code = 107) Position 1 = 26, Position 2 = 28
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
2 jumps found. (Code = 107) Position 1 = 29, Position 2 = -2
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 28
Branch analysis from position: 28
filename:       /in/TdNS3
function name:  ds
number of ops:  31
compiled vars:  !0 = $dir, !1 = $s, !2 = $fs, !3 = $f, !4 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        ASSIGN                                                   !1, 0
          2        NEW                                              $6      'RecursiveIteratorIterator'
          3        NEW                                              $7      'RecursiveDirectoryIterator'
          4        SEND_VAR_EX                                              !0
          5        DO_FCALL                                      0          
          6        SEND_VAR_NO_REF_EX                                       $7
          7        DO_FCALL                                      0          
          8        ASSIGN                                           ~10     !2, $6
          9      > FE_RESET_R                                       $11     ~10, ->19
         10    > > FE_FETCH_R                                               $11, !3, ->19
         11    >   INIT_METHOD_CALL                                         !3, 'getSize'
         12        DO_FCALL                                      0  $12     
         13        ASSIGN_OP                                     1          !1, $12
         14      > JMP                                                      ->18
         15  E > > CATCH                                       last         'UnexpectedValueException'
         16    >   FE_FREE                                                  $11
         17      > RETURN                                                   !1
         18    > > JMP                                                      ->10
         19    >   FE_FREE                                                  $11
         20        INIT_FCALL_BY_NAME                                       'b'
         21        SEND_VAR_EX                                              !1
         22        DO_FCALL                                      0  $14     
         23      > RETURN                                                   $14
         24*       JMP                                                      ->30
         25  E > > CATCH                                                    'UnexpectedValueException', ->28
         26    > > RETURN                                                   'xxxx'
         27*       JMP                                                      ->30
         28  E > > CATCH                                       last         'RuntimeException'
         29    > > RETURN                                                   'xxxx'
         30*     > RETURN                                                   null

End of function ds

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.51 ms | 1403 KiB | 16 Q