3v4l.org

run code in 300+ 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(); } } $nb = pack('H*', '00'); $php5 = 'O:9:"Container":2:{s:20:"' . $nb . 'Container' . $nb . 'container";C:11:"ArrayObject":53:{x:i:0;a:2:{i:0;s:5:"test1";i:1;s:5:"test2";};m:a:0:{}}s:19:"' . $nb . 'Container' . $nb . 'iterator";C:13:"ArrayIterator":26:{x:i:16777216;r:2;;m:a:0:{}}}'; $container = unserialize($php5); 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 = 23, Position 2 = 30
Branch analysis from position: 23
2 jumps found. (Code = 78) Position 1 = 24, Position 2 = 30
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 30
filename:       /in/ehJiR
function name:  (null)
number of ops:  32
compiled vars:  !0 = $nb, !1 = $php5, !2 = $container, !3 = $value, !4 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'container'
   45     1        INIT_FCALL                                               'pack'
          2        SEND_VAL                                                 'H%2A'
          3        SEND_VAL                                                 '00'
          4        DO_ICALL                                         $5      
          5        ASSIGN                                                   !0, $5
   46     6        CONCAT                                           ~7      'O%3A9%3A%22Container%22%3A2%3A%7Bs%3A20%3A%22', !0
          7        CONCAT                                           ~8      ~7, 'Container'
          8        CONCAT                                           ~9      ~8, !0
          9        CONCAT                                           ~10     ~9, 'container%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%22'
         10        CONCAT                                           ~11     ~10, !0
         11        CONCAT                                           ~12     ~11, 'Container'
         12        CONCAT                                           ~13     ~12, !0
         13        CONCAT                                           ~14     ~13, 'iterator%22%3BC%3A13%3A%22ArrayIterator%22%3A26%3A%7Bx%3Ai%3A16777216%3Br%3A2%3B%3Bm%3Aa%3A0%3A%7B%7D%7D%7D'
         14        ASSIGN                                                   !1, ~14
   48    15        INIT_FCALL                                               'unserialize'
         16        SEND_VAR                                                 !1
         17        DO_ICALL                                         $16     
         18        ASSIGN                                                   !2, $16
   49    19        INIT_FCALL                                               'var_dump'
         20        SEND_VAR                                                 !2
         21        DO_ICALL                                                 
   51    22      > FE_RESET_R                                       $19     !2, ->30
         23    > > FE_FETCH_R                                       ~20     $19, !3, ->30
         24    >   ASSIGN                                                   !4, ~20
   53    25        CONCAT                                           ~22     !4, '+%3D%3E+'
         26        CONCAT                                           ~23     ~22, !3
         27        CONCAT                                           ~24     ~23, '%0A'
         28        ECHO                                                     ~24
   51    29      > JMP                                                      ->23
         30    >   FE_FREE                                                  $19
   54    31      > RETURN                                                   1

Class Container:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ehJiR
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/ehJiR
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/ehJiR
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/ehJiR
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/ehJiR
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/ehJiR
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/ehJiR
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.0.0


preferences:
134.16 ms | 1409 KiB | 19 Q