3v4l.org

run code in 500+ PHP versions simultaneously
<?php $content = <<<'EOF' Line 1 Line 2 Line 3 Line 4 EOF; $tmpCsvFile = new SplTempFileObject(); $tmpCsvFile->fwrite($content); $iterator = new CallbackFilterIterator($tmpCsvFile, function ($row) { return true; }); echo 'Limit 2: ', iterator_count(new LimitIterator($iterator, 2)), ' ', iterator_count(new LimitIterator($tmpCsvFile, 2)), "\n"; echo 'Limit 3: ', iterator_count(new LimitIterator($iterator, 3)), ' ', iterator_count(new LimitIterator($tmpCsvFile, 3)), "\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AJBR9
function name:  (null)
number of ops:  52
compiled vars:  !0 = $content, !1 = $tmpCsvFile, !2 = $iterator
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, 'Line+1%0ALine+2%0ALine+3%0ALine+4'
   10     1        NEW                                                  $4      'SplTempFileObject'
          2        DO_FCALL                                          0          
          3        ASSIGN                                                       !1, $4
   11     4        INIT_METHOD_CALL                                             !1, 'fwrite'
          5        SEND_VAR_EX                                                  !0
          6        DO_FCALL                                          0          
   13     7        NEW                                                  $8      'CallbackFilterIterator'
          8        SEND_VAR_EX                                                  !1
          9        DECLARE_LAMBDA_FUNCTION                              ~9      [0]
   15    10        SEND_VAL_EX                                                  ~9
   13    11        DO_FCALL                                          0          
         12        ASSIGN                                                       !2, $8
   17    13        ECHO                                                         'Limit+2%3A+'
         14        INIT_FCALL                                                   'iterator_count'
         15        NEW                                                  $12     'LimitIterator'
         16        SEND_VAR_EX                                                  !2
         17        SEND_VAL_EX                                                  2
         18        DO_FCALL                                          0          
         19        SEND_VAR                                                     $12
         20        DO_ICALL                                             $14     
         21        ECHO                                                         $14
         22        ECHO                                                         '+'
         23        INIT_FCALL                                                   'iterator_count'
         24        NEW                                                  $15     'LimitIterator'
         25        SEND_VAR_EX                                                  !1
         26        SEND_VAL_EX                                                  2
         27        DO_FCALL                                          0          
         28        SEND_VAR                                                     $15
         29        DO_ICALL                                             $17     
         30        ECHO                                                         $17
         31        ECHO                                                         '%0A'
   18    32        ECHO                                                         'Limit+3%3A+'
         33        INIT_FCALL                                                   'iterator_count'
         34        NEW                                                  $18     'LimitIterator'
         35        SEND_VAR_EX                                                  !2
         36        SEND_VAL_EX                                                  3
         37        DO_FCALL                                          0          
         38        SEND_VAR                                                     $18
         39        DO_ICALL                                             $20     
         40        ECHO                                                         $20
         41        ECHO                                                         '+'
         42        INIT_FCALL                                                   'iterator_count'
         43        NEW                                                  $21     'LimitIterator'
         44        SEND_VAR_EX                                                  !1
         45        SEND_VAL_EX                                                  3
         46        DO_FCALL                                          0          
         47        SEND_VAR                                                     $21
         48        DO_ICALL                                             $23     
         49        ECHO                                                         $23
         50        ECHO                                                         '%0A'
         51      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AJBR9
function name:  {closure:/in/AJBR9:13}
number of ops:  3
compiled vars:  !0 = $row
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   13     0  E >   RECV                                                 !0      
   14     1      > RETURN                                                       <true>
   15     2*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
160.88 ms | 2642 KiB | 14 Q