3v4l.org

run code in 500+ PHP versions simultaneously
<?php function processInner($line) { $tok = strtok($line, ","); while ($tok !== false) { echo "Entry=$tok\n"; $tok = strtok(","); } } function processOuter($csv) { $line = strtok($csv, "\n"); while ($line !== false) { processInner($line); $line = strtok("\n"); } } processOuter("foo,bar,baz\na,b,c\n1,2,3");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XNl3X
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   21     0  E >   INIT_FCALL                                                   'processouter'
          1        SEND_VAL                                                     'foo%2Cbar%2Cbaz%0Aa%2Cb%2Cc%0A1%2C2%2C3'
          2        DO_FCALL                                          0          
          3      > RETURN                                                       1

Function processinner:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 7
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 7
Branch analysis from position: 17
Branch analysis from position: 7
filename:       /in/XNl3X
function name:  processInner
number of ops:  18
compiled vars:  !0 = $line, !1 = $tok
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   RECV                                                 !0      
    4     1        INIT_FCALL                                                   'strtok'
          2        SEND_VAR                                                     !0
          3        SEND_VAL                                                     '%2C'
          4        DO_ICALL                                             $2      
          5        ASSIGN                                                       !1, $2
    6     6      > JMP                                                          ->15
    7     7    >   ROPE_INIT                                         3  ~5      'Entry%3D'
          8        ROPE_ADD                                          1  ~5      ~5, !1
          9        ROPE_END                                          2  ~4      ~5, '%0A'
         10        ECHO                                                         ~4
    8    11        INIT_FCALL                                                   'strtok'
         12        SEND_VAL                                                     '%2C'
         13        DO_ICALL                                             $7      
         14        ASSIGN                                                       !1, $7
    6    15    >   TYPE_CHECK                                      1018          !1
         16      > JMPNZ                                                        ~9, ->7
   10    17    > > RETURN                                                       null

End of function processinner

Function processouter:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 7
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 7
Branch analysis from position: 16
Branch analysis from position: 7
filename:       /in/XNl3X
function name:  processOuter
number of ops:  17
compiled vars:  !0 = $csv, !1 = $line
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   12     0  E >   RECV                                                 !0      
   13     1        INIT_FCALL                                                   'strtok'
          2        SEND_VAR                                                     !0
          3        SEND_VAL                                                     '%0A'
          4        DO_ICALL                                             $2      
          5        ASSIGN                                                       !1, $2
   15     6      > JMP                                                          ->14
   16     7    >   INIT_FCALL                                                   'processinner'
          8        SEND_VAR                                                     !1
          9        DO_FCALL                                          0          
   17    10        INIT_FCALL                                                   'strtok'
         11        SEND_VAL                                                     '%0A'
         12        DO_ICALL                                             $5      
         13        ASSIGN                                                       !1, $5
   15    14    >   TYPE_CHECK                                      1018          !1
         15      > JMPNZ                                                        ~7, ->7
   19    16    > > RETURN                                                       null

End of function processouter

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
173.05 ms | 1594 KiB | 16 Q