3v4l.org

run code in 300+ PHP versions simultaneously
<?php $fruits = array( "apple" => "yummy", "orange" => "ah ya, nice", "grape" => "wow, I love it!", "plum" => "nah, not me" ); $obj = new ArrayObject( $fruits ); $it = $obj->getIterator(); // How many items are we iterating over? echo "Iterating over: " . $obj->count() . " values\n"; // Iterate over the values in the ArrayObject: while( $it->valid() ) { echo $it->key() . "=" . $it->current() . "\n"; $it->next(); } // The good thing here is that it can be iterated with foreach loop foreach ($it as $key=>$val) echo $key.":".$val."\n"; /* Outputs something like */ /*Iterating over: 4 values apple=yummy orange=ah ya, nice grape=wow, I love it! plum=nah, not me*/ ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
2 jumps found. (Code = 44) Position 1 = 27, Position 2 = 14
Branch analysis from position: 27
2 jumps found. (Code = 77) Position 1 = 28, Position 2 = 35
Branch analysis from position: 28
2 jumps found. (Code = 78) Position 1 = 29, Position 2 = 35
Branch analysis from position: 29
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
Branch analysis from position: 35
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 35
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 27, Position 2 = 14
Branch analysis from position: 27
Branch analysis from position: 14
filename:       /in/aCIK0
function name:  (null)
number of ops:  37
compiled vars:  !0 = $fruits, !1 = $obj, !2 = $it, !3 = $val, !4 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    8     1        NEW                                              $6      'ArrayObject'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $6
    9     5        INIT_METHOD_CALL                                         !1, 'getIterator'
          6        DO_FCALL                                      0  $9      
          7        ASSIGN                                                   !2, $9
   13     8        INIT_METHOD_CALL                                         !1, 'count'
          9        DO_FCALL                                      0  $11     
         10        CONCAT                                           ~12     'Iterating+over%3A+', $11
         11        CONCAT                                           ~13     ~12, '+values%0A'
         12        ECHO                                                     ~13
   16    13      > JMP                                                      ->24
   18    14    >   INIT_METHOD_CALL                                         !2, 'key'
         15        DO_FCALL                                      0  $14     
         16        CONCAT                                           ~15     $14, '%3D'
         17        INIT_METHOD_CALL                                         !2, 'current'
         18        DO_FCALL                                      0  $16     
         19        CONCAT                                           ~17     ~15, $16
         20        CONCAT                                           ~18     ~17, '%0A'
         21        ECHO                                                     ~18
   19    22        INIT_METHOD_CALL                                         !2, 'next'
         23        DO_FCALL                                      0          
   16    24    >   INIT_METHOD_CALL                                         !2, 'valid'
         25        DO_FCALL                                      0  $20     
         26      > JMPNZ                                                    $20, ->14
   24    27    > > FE_RESET_R                                       $21     !2, ->35
         28    > > FE_FETCH_R                                       ~22     $21, !3, ->35
         29    >   ASSIGN                                                   !4, ~22
   25    30        CONCAT                                           ~24     !4, '%3A'
         31        CONCAT                                           ~25     ~24, !3
         32        CONCAT                                           ~26     ~25, '%0A'
         33        ECHO                                                     ~26
   24    34      > JMP                                                      ->28
         35    >   FE_FREE                                                  $21
   35    36      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.31 ms | 1399 KiB | 13 Q