3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Container implements Iterator { private $container; private $iterator; public function __construct() { $this->container = new ArrayObject(); $this->iterator = $this->container->getIterator(); } public function append($element) { $this->container->append($element); } public function current() { return $this->iterator->current(); } public function next() { $this->iterator->next(); } public function key() { return $this->iterator->key(); } public function valid() { return $this->iterator->valid(); } public function rewind() { $this->iterator->rewind(); } } $php7 = 'O:9:"Container":2:{s:20:"Containercontainer";C:11:"ArrayObject":53:{x:i:0;a:2:{i:0;s:5:"test1";i:1;s:5:"test2";};m:a:0:{}}s:19:"Containeriterator";C:13:"ArrayIterator":19:{x:i:0;r:2;;m:a:0:{}}}'; $container = unserialize($php7); var_dump($container); foreach ($container as $key => $value) { echo $key . ' => ' . $value . PHP_EOL; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 17
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 17
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/EcAWQ
function name:  (null)
number of ops:  19
compiled vars:  !0 = $php7, !1 = $container, !2 = $value, !3 = $key
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                                'container'
   45     1        ASSIGN                                                       !0, 'O%3A9%3A%22Container%22%3A2%3A%7Bs%3A20%3A%22Containercontainer%22%3BC%3A11%3A%22ArrayObject%22%3A53%3A%7Bx%3Ai%3A0%3Ba%3A2%3A%7Bi%3A0%3Bs%3A5%3A%22test1%22%3Bi%3A1%3Bs%3A5%3A%22test2%22%3B%7D%3Bm%3Aa%3A0%3A%7B%7D%7Ds%3A19%3A%22Containeriterator%22%3BC%3A13%3A%22ArrayIterator%22%3A19%3A%7Bx%3Ai%3A0%3Br%3A2%3B%3Bm%3Aa%3A0%3A%7B%7D%7D%7D'
   47     2        INIT_FCALL                                                   'unserialize'
          3        SEND_VAR                                                     !0
          4        DO_ICALL                                             $5      
          5        ASSIGN                                                       !1, $5
   48     6        INIT_FCALL                                                   'var_dump'
          7        SEND_VAR                                                     !1
          8        DO_ICALL                                                     
   50     9      > FE_RESET_R                                           $8      !1, ->17
         10    > > FE_FETCH_R                                           ~9      $8, !2, ->17
         11    >   ASSIGN                                                       !3, ~9
   52    12        CONCAT                                               ~11     !3, '+%3D%3E+'
         13        CONCAT                                               ~12     ~11, !2
         14        CONCAT                                               ~13     ~12, '%0A'
         15        ECHO                                                         ~13
   50    16      > JMP                                                          ->10
         17    >   FE_FREE                                                      $8
   53    18      > RETURN                                                       1

Class Container:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EcAWQ
function name:  __construct
number of ops:  10
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   10     0  E >   NEW                                                  $1      'ArrayObject'
          1        DO_FCALL                                          0          
          2        ASSIGN_OBJ                                                   'container'
          3        OP_DATA                                                      $1
   11     4        FETCH_OBJ_R                                          ~4      'container'
          5        INIT_METHOD_CALL                                             ~4, 'getIterator'
          6        DO_FCALL                                          0  $5      
          7        ASSIGN_OBJ                                                   'iterator'
          8        OP_DATA                                                      $5
   12     9      > RETURN                                                       null

End of function __construct

Function append:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EcAWQ
function name:  append
number of ops:  6
compiled vars:  !0 = $element
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   14     0  E >   RECV                                                 !0      
   16     1        FETCH_OBJ_R                                          ~1      'container'
          2        INIT_METHOD_CALL                                             ~1, 'append'
          3        SEND_VAR_EX                                                  !0
          4        DO_FCALL                                          0          
   17     5      > RETURN                                                       null

End of function append

Function current:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EcAWQ
function name:  current
number of ops:  5
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   21     0  E >   FETCH_OBJ_R                                          ~0      'iterator'
          1        INIT_METHOD_CALL                                             ~0, 'current'
          2        DO_FCALL                                          0  $1      
          3      > RETURN                                                       $1
   22     4*     > RETURN                                                       null

End of function current

Function next:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EcAWQ
function name:  next
number of ops:  4
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   26     0  E >   FETCH_OBJ_R                                          ~0      'iterator'
          1        INIT_METHOD_CALL                                             ~0, 'next'
          2        DO_FCALL                                          0          
   27     3      > RETURN                                                       null

End of function next

Function key:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EcAWQ
function name:  key
number of ops:  5
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   31     0  E >   FETCH_OBJ_R                                          ~0      'iterator'
          1        INIT_METHOD_CALL                                             ~0, 'key'
          2        DO_FCALL                                          0  $1      
          3      > RETURN                                                       $1
   32     4*     > RETURN                                                       null

End of function key

Function valid:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EcAWQ
function name:  valid
number of ops:  5
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   36     0  E >   FETCH_OBJ_R                                          ~0      'iterator'
          1        INIT_METHOD_CALL                                             ~0, 'valid'
          2        DO_FCALL                                          0  $1      
          3      > RETURN                                                       $1
   37     4*     > RETURN                                                       null

End of function valid

Function rewind:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EcAWQ
function name:  rewind
number of ops:  4
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   41     0  E >   FETCH_OBJ_R                                          ~0      'iterator'
          1        INIT_METHOD_CALL                                             ~0, 'rewind'
          2        DO_FCALL                                          0          
   42     3      > RETURN                                                       null

End of function rewind

End of class Container.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
128.84 ms | 487 KiB | 9 Q