3v4l.org

run code in 300+ PHP versions simultaneously
<?php $target_dir = "in/"; $target_filename = 'asurite_hw1.m'; // Splits the input file name and its extension. $base_name = pathinfo($target_filename, PATHINFO_FILENAME); $extension = pathinfo($target_filename, PATHINFO_EXTENSION); echo 'base_name: ' . $base_name . "\n"; echo 'extension: ' . $extension . "\n"; $previous_files = glob($target_dir . $base_name . '*'); $previous_files = array('asurite_hw1_1.m'); $id = 1; foreach ($previous_files as $f) { $r = preg_match('/.+_(\d+)\.m/', $f, $matches); if (count($matches) > 1 && $id <= $matches[1]) { $id = $id + 1; } } print_r($id); // $pattern = '/^asurite ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 27, Position 2 = 44
Branch analysis from position: 27
2 jumps found. (Code = 78) Position 1 = 28, Position 2 = 44
Branch analysis from position: 28
2 jumps found. (Code = 46) Position 1 = 37, Position 2 = 40
Branch analysis from position: 37
2 jumps found. (Code = 43) Position 1 = 41, Position 2 = 43
Branch analysis from position: 41
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
Branch analysis from position: 43
Branch analysis from position: 40
Branch analysis from position: 44
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 44
filename:       /in/8eNsL
function name:  (null)
number of ops:  49
compiled vars:  !0 = $target_dir, !1 = $target_filename, !2 = $base_name, !3 = $extension, !4 = $previous_files, !5 = $id, !6 = $f, !7 = $r, !8 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'in%2F'
    4     1        ASSIGN                                                   !1, 'asurite_hw1.m'
    7     2        INIT_FCALL                                               'pathinfo'
          3        SEND_VAR                                                 !1
          4        SEND_VAL                                                 8
          5        DO_ICALL                                         $11     
          6        ASSIGN                                                   !2, $11
    8     7        INIT_FCALL                                               'pathinfo'
          8        SEND_VAR                                                 !1
          9        SEND_VAL                                                 4
         10        DO_ICALL                                         $13     
         11        ASSIGN                                                   !3, $13
    9    12        CONCAT                                           ~15     'base_name%3A+', !2
         13        CONCAT                                           ~16     ~15, '%0A'
         14        ECHO                                                     ~16
   10    15        CONCAT                                           ~17     'extension%3A+', !3
         16        CONCAT                                           ~18     ~17, '%0A'
         17        ECHO                                                     ~18
   12    18        INIT_FCALL                                               'glob'
         19        CONCAT                                           ~19     !0, !2
         20        CONCAT                                           ~20     ~19, '%2A'
         21        SEND_VAL                                                 ~20
         22        DO_ICALL                                         $21     
         23        ASSIGN                                                   !4, $21
   13    24        ASSIGN                                                   !4, <array>
   15    25        ASSIGN                                                   !5, 1
   16    26      > FE_RESET_R                                       $25     !4, ->44
         27    > > FE_FETCH_R                                               $25, !6, ->44
   17    28    >   INIT_FCALL                                               'preg_match'
         29        SEND_VAL                                                 '%2F.%2B_%28%5Cd%2B%29%5C.m%2F'
         30        SEND_VAR                                                 !6
         31        SEND_REF                                                 !8
         32        DO_ICALL                                         $26     
         33        ASSIGN                                                   !7, $26
   18    34        COUNT                                            ~28     !8
         35        IS_SMALLER                                       ~29     1, ~28
         36      > JMPZ_EX                                          ~29     ~29, ->40
         37    >   FETCH_DIM_R                                      ~30     !8, 1
         38        IS_SMALLER_OR_EQUAL                              ~31     !5, ~30
         39        BOOL                                             ~29     ~31
         40    > > JMPZ                                                     ~29, ->43
   19    41    >   ADD                                              ~32     !5, 1
         42        ASSIGN                                                   !5, ~32
   16    43    > > JMP                                                      ->27
         44    >   FE_FREE                                                  $25
   23    45        INIT_FCALL                                               'print_r'
         46        SEND_VAR                                                 !5
         47        DO_ICALL                                                 
   28    48      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.6 ms | 1400 KiB | 21 Q