3v4l.org

run code in 500+ PHP versions simultaneously
<?php $iteratorx = IntlCodePointBreakIterator::createCodePointInstance(); $iteratorx->setText("abc"); $iterator = $iteratorx->getPartsIterator(); $iterator->rewind(); $iterator->next(); $iteratorx->previous(); // previous works $iterator->next(); $iterator->next(); echo $iterator->current() . "\n"; // c... all fine $iterator->next(); // no more code points, so it's invalid var_dump($iterator->valid()); // false var_dump($iterator->current()); // prints weird stuff... whatever... $iteratorx->previous(); // cannot go back var_dump($iterator->valid()); // broken var_dump($iterator->current()); // broken
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/A125P
function name:  (null)
number of ops:  48
compiled vars:  !0 = $iteratorx, !1 = $iterator
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   INIT_STATIC_METHOD_CALL                                      'IntlCodePointBreakIterator', 'createCodePointInstance'
          1        DO_FCALL                                          0  $2      
          2        ASSIGN                                                       !0, $2
    4     3        INIT_METHOD_CALL                                             !0, 'setText'
          4        SEND_VAL_EX                                                  'abc'
          5        DO_FCALL                                          0          
    6     6        INIT_METHOD_CALL                                             !0, 'getPartsIterator'
          7        DO_FCALL                                          0  $5      
          8        ASSIGN                                                       !1, $5
    7     9        INIT_METHOD_CALL                                             !1, 'rewind'
         10        DO_FCALL                                          0          
    8    11        INIT_METHOD_CALL                                             !1, 'next'
         12        DO_FCALL                                          0          
    9    13        INIT_METHOD_CALL                                             !0, 'previous'
         14        DO_FCALL                                          0          
   10    15        INIT_METHOD_CALL                                             !1, 'next'
         16        DO_FCALL                                          0          
   11    17        INIT_METHOD_CALL                                             !1, 'next'
         18        DO_FCALL                                          0          
   12    19        INIT_METHOD_CALL                                             !1, 'current'
         20        DO_FCALL                                          0  $12     
         21        CONCAT                                               ~13     $12, '%0A'
         22        ECHO                                                         ~13
   14    23        INIT_METHOD_CALL                                             !1, 'next'
         24        DO_FCALL                                          0          
   15    25        INIT_FCALL                                                   'var_dump'
         26        INIT_METHOD_CALL                                             !1, 'valid'
         27        DO_FCALL                                          0  $15     
         28        SEND_VAR                                                     $15
         29        DO_ICALL                                                     
   16    30        INIT_FCALL                                                   'var_dump'
         31        INIT_METHOD_CALL                                             !1, 'current'
         32        DO_FCALL                                          0  $17     
         33        SEND_VAR                                                     $17
         34        DO_ICALL                                                     
   18    35        INIT_METHOD_CALL                                             !0, 'previous'
         36        DO_FCALL                                          0          
   19    37        INIT_FCALL                                                   'var_dump'
         38        INIT_METHOD_CALL                                             !1, 'valid'
         39        DO_FCALL                                          0  $20     
         40        SEND_VAR                                                     $20
         41        DO_ICALL                                                     
   20    42        INIT_FCALL                                                   'var_dump'
         43        INIT_METHOD_CALL                                             !1, 'current'
         44        DO_FCALL                                          0  $22     
         45        SEND_VAR                                                     $22
         46        DO_ICALL                                                     
         47      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
157.68 ms | 2085 KiB | 13 Q