3v4l.org

run code in 300+ PHP versions simultaneously
<?php $content = <<<'EOF' Line 1 Line 2 EOF; $tmpCsvFile = new SplTempFileObject(); $tmpCsvFile->fwrite($content); $iterator = new CallbackFilterIterator($tmpCsvFile, function ($row) { return true; }); echo 'l1: ', iterator_count(new LimitIterator($iterator, 2)), ' ', iterator_count(new LimitIterator($tmpCsvFile, 2)), "\n"; echo 'l2: ', 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/F0umk
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'
    8     1        NEW                                              $4      'SplTempFileObject'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $4
    9     4        INIT_METHOD_CALL                                         !1, 'fwrite'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0          
   11     7        NEW                                              $8      'CallbackFilterIterator'
          8        SEND_VAR_EX                                              !1
          9        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FF0umk%3A11%240'
   13    10        SEND_VAL_EX                                              ~9
         11        DO_FCALL                                      0          
   11    12        ASSIGN                                                   !2, $8
   15    13        ECHO                                                     'l1%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'
   16    32        ECHO                                                     'l2%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

Function %00%7Bclosure%7D%2Fin%2FF0umk%3A11%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/F0umk
function name:  {closure}
number of ops:  3
compiled vars:  !0 = $row
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   12     1      > RETURN                                                   <true>
   13     2*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FF0umk%3A11%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.6 ms | 1392 KiB | 15 Q