3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arrayIterator = new ArrayIterator(array('test 1' => ['derp'], 'another test', 'test 123')); $regexIterator = new RegexIterator($arrayIterator, '/^test/', RegexIterator::REPLACE, RegexIterator::USE_KEY); $regexIterator->replacement = ''; foreach ($regexIterator as $value) { var_dump($value); echo "\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 14, Position 2 = 20
Branch analysis from position: 14
2 jumps found. (Code = 78) Position 1 = 15, Position 2 = 20
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
filename:       /in/TbNf3
function name:  (null)
number of ops:  22
compiled vars:  !0 = $arrayIterator, !1 = $regexIterator, !2 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   NEW                                              $3      'ArrayIterator'
          1        SEND_VAL_EX                                              <array>
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $3
    3     4        NEW                                              $6      'RegexIterator'
          5        SEND_VAR_EX                                              !0
          6        SEND_VAL_EX                                              '%2F%5Etest%2F'
          7        SEND_VAL_EX                                              4
          8        SEND_VAL_EX                                              1
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !1, $6
    4    11        ASSIGN_OBJ                                               !1, 'replacement'
         12        OP_DATA                                                  ''
    6    13      > FE_RESET_R                                       $10     !1, ->20
         14    > > FE_FETCH_R                                               $10, !2, ->20
    7    15    >   INIT_FCALL                                               'var_dump'
         16        SEND_VAR                                                 !2
         17        DO_ICALL                                                 
    8    18        ECHO                                                     '%0A'
    6    19      > JMP                                                      ->14
         20    >   FE_FREE                                                  $10
    9    21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.91 ms | 1395 KiB | 15 Q