3v4l.org

run code in 300+ PHP versions simultaneously
<?php function v1($data) { $start = 0; while (($stop = strpos($data, "\n", $start)) !== false) { $len = $stop-$start; if ($len > 0 && $data[$stop-1] === "\r") { $len -= 1; } $line = substr($data, $start, $len); if (isset($line[0]) && $line[0] === '.') { $line = '.' . $line; } //send $start = $stop + 1; } //last line $line = substr($data, $start); if (isset($line[0]) && $line[0] === '.') { $line = '.' . $line; } //send } $data = str_repeat("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\r\n", 100000); v1($data);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BK4tX
function name:  (null)
number of ops:  9
compiled vars:  !0 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   INIT_FCALL                                               'str_repeat'
          1        SEND_VAL                                                 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa%0D%0A'
          2        SEND_VAL                                                 100000
          3        DO_ICALL                                         $1      
          4        ASSIGN                                                   !0, $1
   28     5        INIT_FCALL                                               'v1'
          6        SEND_VAR                                                 !0
          7        DO_FCALL                                      0          
          8      > RETURN                                                   1

Function v1:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
2 jumps found. (Code = 44) Position 1 = 37, Position 2 = 3
Branch analysis from position: 37
2 jumps found. (Code = 46) Position 1 = 44, Position 2 = 47
Branch analysis from position: 44
2 jumps found. (Code = 43) Position 1 = 48, Position 2 = 50
Branch analysis from position: 48
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 50
Branch analysis from position: 47
Branch analysis from position: 3
2 jumps found. (Code = 46) Position 1 = 7, Position 2 = 11
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 13
Branch analysis from position: 12
2 jumps found. (Code = 46) Position 1 = 21, Position 2 = 24
Branch analysis from position: 21
2 jumps found. (Code = 43) Position 1 = 25, Position 2 = 27
Branch analysis from position: 25
2 jumps found. (Code = 44) Position 1 = 37, Position 2 = 3
Branch analysis from position: 37
Branch analysis from position: 3
Branch analysis from position: 27
Branch analysis from position: 24
Branch analysis from position: 13
Branch analysis from position: 11
filename:       /in/BK4tX
function name:  v1
number of ops:  51
compiled vars:  !0 = $data, !1 = $start, !2 = $len, !3 = $stop, !4 = $line
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        ASSIGN                                                   !1, 0
    5     2      > JMP                                                      ->29
    6     3    >   SUB                                              ~6      !3, !1
          4        ASSIGN                                                   !2, ~6
    7     5        IS_SMALLER                                       ~8      0, !2
          6      > JMPZ_EX                                          ~8      ~8, ->11
          7    >   SUB                                              ~9      !3, 1
          8        FETCH_DIM_R                                      ~10     !0, ~9
          9        IS_IDENTICAL                                     ~11     ~10, '%0D'
         10        BOOL                                             ~8      ~11
         11    > > JMPZ                                                     ~8, ->13
    8    12    >   ASSIGN_OP                                     2          !2, 1
   10    13    >   INIT_FCALL                                               'substr'
         14        SEND_VAR                                                 !0
         15        SEND_VAR                                                 !1
         16        SEND_VAR                                                 !2
         17        DO_ICALL                                         $13     
         18        ASSIGN                                                   !4, $13
   12    19        ISSET_ISEMPTY_DIM_OBJ                         0  ~15     !4, 0
         20      > JMPZ_EX                                          ~15     ~15, ->24
         21    >   FETCH_DIM_R                                      ~16     !4, 0
         22        IS_IDENTICAL                                     ~17     ~16, '.'
         23        BOOL                                             ~15     ~17
         24    > > JMPZ                                                     ~15, ->27
   13    25    >   CONCAT                                           ~18     '.', !4
         26        ASSIGN                                                   !4, ~18
   16    27    >   ADD                                              ~20     !3, 1
         28        ASSIGN                                                   !1, ~20
    5    29    >   INIT_FCALL                                               'strpos'
         30        SEND_VAR                                                 !0
         31        SEND_VAL                                                 '%0A'
         32        SEND_VAR                                                 !1
         33        DO_ICALL                                         $22     
         34        ASSIGN                                           ~23     !3, $22
         35        TYPE_CHECK                                  1018          ~23
         36      > JMPNZ                                                    ~24, ->3
   19    37    >   INIT_FCALL                                               'substr'
         38        SEND_VAR                                                 !0
         39        SEND_VAR                                                 !1
         40        DO_ICALL                                         $25     
         41        ASSIGN                                                   !4, $25
   20    42        ISSET_ISEMPTY_DIM_OBJ                         0  ~27     !4, 0
         43      > JMPZ_EX                                          ~27     ~27, ->47
         44    >   FETCH_DIM_R                                      ~28     !4, 0
         45        IS_IDENTICAL                                     ~29     ~28, '.'
         46        BOOL                                             ~27     ~29
         47    > > JMPZ                                                     ~27, ->50
   21    48    >   CONCAT                                           ~30     '.', !4
         49        ASSIGN                                                   !4, ~30
   24    50    > > RETURN                                                   null

End of function v1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
185.08 ms | 1403 KiB | 20 Q