3v4l.org

run code in 300+ PHP versions simultaneously
<?php $scandir = scandir('c:/keycounter'); $stats = array(); foreach($scandir as $filename){ if(substr($filename, -4) !== '.day') continue; $date = substr($filename, 0, -4); $stats[$date]= array('k' => 0, 'm' => 0); $content = file_get_contents('c:/keycounter/'.$filename); $lines = explode("\n", $content); foreach($lines as $line){ if($line === '') { continue; } $exp2 = explode(",", $line); $stats[$date]['k']+=intval($exp2[0]); $stats[$date]['m']+=intval($exp2[1]); } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 55
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 55
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 14
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 14
2 jumps found. (Code = 77) Position 1 = 33, Position 2 = 53
Branch analysis from position: 33
2 jumps found. (Code = 78) Position 1 = 34, Position 2 = 53
Branch analysis from position: 34
2 jumps found. (Code = 43) Position 1 = 36, Position 2 = 37
Branch analysis from position: 36
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
Branch analysis from position: 37
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
Branch analysis from position: 53
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 53
Branch analysis from position: 55
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 55
filename:       /in/Dcs5Q
function name:  (null)
number of ops:  57
compiled vars:  !0 = $scandir, !1 = $stats, !2 = $filename, !3 = $date, !4 = $content, !5 = $lines, !6 = $line, !7 = $exp2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'scandir'
          1        SEND_VAL                                                 'c%3A%2Fkeycounter'
          2        DO_ICALL                                         $8      
          3        ASSIGN                                                   !0, $8
    3     4        ASSIGN                                                   !1, <array>
    5     5      > FE_RESET_R                                       $11     !0, ->55
          6    > > FE_FETCH_R                                               $11, !2, ->55
    6     7    >   INIT_FCALL                                               'substr'
          8        SEND_VAR                                                 !2
          9        SEND_VAL                                                 -4
         10        DO_ICALL                                         $12     
         11        IS_NOT_IDENTICAL                                         $12, '.day'
         12      > JMPZ                                                     ~13, ->14
         13    > > JMP                                                      ->6
    7    14    >   INIT_FCALL                                               'substr'
         15        SEND_VAR                                                 !2
         16        SEND_VAL                                                 0
         17        SEND_VAL                                                 -4
         18        DO_ICALL                                         $14     
         19        ASSIGN                                                   !3, $14
    8    20        ASSIGN_DIM                                               !1, !3
         21        OP_DATA                                                  <array>
    9    22        INIT_FCALL                                               'file_get_contents'
         23        CONCAT                                           ~17     'c%3A%2Fkeycounter%2F', !2
         24        SEND_VAL                                                 ~17
         25        DO_ICALL                                         $18     
         26        ASSIGN                                                   !4, $18
   10    27        INIT_FCALL                                               'explode'
         28        SEND_VAL                                                 '%0A'
         29        SEND_VAR                                                 !4
         30        DO_ICALL                                         $20     
         31        ASSIGN                                                   !5, $20
   11    32      > FE_RESET_R                                       $22     !5, ->53
         33    > > FE_FETCH_R                                               $22, !6, ->53
   12    34    >   IS_IDENTICAL                                             !6, ''
         35      > JMPZ                                                     ~23, ->37
   13    36    > > JMP                                                      ->33
   15    37    >   INIT_FCALL                                               'explode'
         38        SEND_VAL                                                 '%2C'
         39        SEND_VAR                                                 !6
         40        DO_ICALL                                         $24     
         41        ASSIGN                                                   !7, $24
   16    42        FETCH_DIM_R                                      ~28     !7, 0
         43        CAST                                          4  ~29     ~28
         44        FETCH_DIM_RW                                     $26     !1, !3
         45        ASSIGN_DIM_OP                +=               1          $26, 'k'
         46        OP_DATA                                                  ~29
   17    47        FETCH_DIM_R                                      ~32     !7, 1
         48        CAST                                          4  ~33     ~32
         49        FETCH_DIM_RW                                     $30     !1, !3
         50        ASSIGN_DIM_OP                +=               1          $30, 'm'
         51        OP_DATA                                                  ~33
   11    52      > JMP                                                      ->33
         53    >   FE_FREE                                                  $22
    5    54      > JMP                                                      ->6
         55    >   FE_FREE                                                  $11
   19    56      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.14 ms | 1404 KiB | 21 Q