3v4l.org

run code in 300+ PHP versions simultaneously
<?php class RecursiveArrayObject extends ArrayObject { public function __construct(array $array, $flags=ArrayObject::ARRAY_AS_PROPS) { foreach ($array as $key => $value) { if (is_array($value)) { $value = new self($value,$flags); } $this->_offsetSet($key, $value); } $this->setFlags($flags); } private function _offsetSet($index, $newval) { parent::offsetSet($index, $newval); } public function offsetSet($index, $newval) { var_dump($index); $this->_offsetSet($index, $newval); } public function __set($name, $value) { var_dump($name); var_dump($value); if (is_array($value)) { $value = new self($value,$flags); }else{ $this->offsetSet($name, $value); } } } $baseConfig = new RecursiveArrayObject( array( 'titulo' => 'CAWZ :: Central Admin Web Zone', 'dominio' => $_SERVER['HTTP_HOST'], 'urlActual' => $_SERVER['REQUEST_URI'], 'pagina' => basename($_SERVER['SCRIPT_NAME']), 'basePath' => dirname($_SERVER['DOCUMENT_ROOT']), 'clases' => dirname(dirname($_SERVER['DOCUMENT_ROOT'])) . '/libs', 'plantillas' => dirname($_SERVER['DOCUMENT_ROOT']) . '/plantillas/', 'traducciones' => dirname(dirname($_SERVER['DOCUMENT_ROOT'])) . '/idiomas', 'imagenes' => array( 'apartamentos' => array( 'path' => dirname($_SERVER['DOCUMENT_ROOT']) . '/www/apartamentos', 'sizes' => array('s' => '120x90', 'm' => '120x90', 'l' => '120x90'), ) ), 'idioma' => array( 'base' => 'es', 'locales' => array('es' => 'es_ES.UTF8', 'en' => 'en_US.UTF8') ), 'debug' => true ) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fqLRJ
function name:  (null)
number of ops:  63
compiled vars:  !0 = $baseConfig
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   33     0  E >   NEW                                              $1      'RecursiveArrayObject'
   35     1        INIT_ARRAY                                       ~2      'CAWZ+%3A%3A+Central+Admin+Web+Zone', 'titulo'
   36     2        FETCH_R                      global              ~3      '_SERVER'
          3        FETCH_DIM_R                                      ~4      ~3, 'HTTP_HOST'
          4        ADD_ARRAY_ELEMENT                                ~2      ~4, 'dominio'
   37     5        FETCH_R                      global              ~5      '_SERVER'
          6        FETCH_DIM_R                                      ~6      ~5, 'REQUEST_URI'
          7        ADD_ARRAY_ELEMENT                                ~2      ~6, 'urlActual'
   38     8        INIT_FCALL                                               'basename'
          9        FETCH_R                      global              ~7      '_SERVER'
         10        FETCH_DIM_R                                      ~8      ~7, 'SCRIPT_NAME'
         11        SEND_VAL                                                 ~8
         12        DO_ICALL                                         $9      
         13        ADD_ARRAY_ELEMENT                                ~2      $9, 'pagina'
   39    14        INIT_FCALL                                               'dirname'
         15        FETCH_R                      global              ~10     '_SERVER'
         16        FETCH_DIM_R                                      ~11     ~10, 'DOCUMENT_ROOT'
         17        SEND_VAL                                                 ~11
         18        DO_ICALL                                         $12     
         19        ADD_ARRAY_ELEMENT                                ~2      $12, 'basePath'
   40    20        INIT_FCALL                                               'dirname'
         21        INIT_FCALL                                               'dirname'
         22        FETCH_R                      global              ~13     '_SERVER'
         23        FETCH_DIM_R                                      ~14     ~13, 'DOCUMENT_ROOT'
         24        SEND_VAL                                                 ~14
         25        DO_ICALL                                         $15     
         26        SEND_VAR                                                 $15
         27        DO_ICALL                                         $16     
         28        CONCAT                                           ~17     $16, '%2Flibs'
         29        ADD_ARRAY_ELEMENT                                ~2      ~17, 'clases'
   41    30        INIT_FCALL                                               'dirname'
         31        FETCH_R                      global              ~18     '_SERVER'
         32        FETCH_DIM_R                                      ~19     ~18, 'DOCUMENT_ROOT'
         33        SEND_VAL                                                 ~19
         34        DO_ICALL                                         $20     
         35        CONCAT                                           ~21     $20, '%2Fplantillas%2F'
         36        ADD_ARRAY_ELEMENT                                ~2      ~21, 'plantillas'
   42    37        INIT_FCALL                                               'dirname'
         38        INIT_FCALL                                               'dirname'
         39        FETCH_R                      global              ~22     '_SERVER'
         40        FETCH_DIM_R                                      ~23     ~22, 'DOCUMENT_ROOT'
         41        SEND_VAL                                                 ~23
         42        DO_ICALL                                         $24     
         43        SEND_VAR                                                 $24
         44        DO_ICALL                                         $25     
         45        CONCAT                                           ~26     $25, '%2Fidiomas'
         46        ADD_ARRAY_ELEMENT                                ~2      ~26, 'traducciones'
   45    47        INIT_FCALL                                               'dirname'
         48        FETCH_R                      global              ~27     '_SERVER'
         49        FETCH_DIM_R                                      ~28     ~27, 'DOCUMENT_ROOT'
         50        SEND_VAL                                                 ~28
         51        DO_ICALL                                         $29     
         52        CONCAT                                           ~30     $29, '%2Fwww%2Fapartamentos'
         53        INIT_ARRAY                                       ~31     ~30, 'path'
   35    54        ADD_ARRAY_ELEMENT                                ~31     <array>, 'sizes'
         55        INIT_ARRAY                                       ~32     ~31, 'apartamentos'
         56        ADD_ARRAY_ELEMENT                                ~2      ~32, 'imagenes'
         57        ADD_ARRAY_ELEMENT                                ~2      <array>, 'idioma'
         58        ADD_ARRAY_ELEMENT                                ~2      <true>, 'debug'
         59        SEND_VAL_EX                                              ~2
         60        DO_FCALL                                      0          
   33    61        ASSIGN                                                   !0, $1
   55    62      > RETURN                                                   1

Class RecursiveArrayObject:
Function __construct:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 17
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 17
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 12
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 12
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/fqLRJ
function name:  __construct
number of ops:  22
compiled vars:  !0 = $array, !1 = $flags, !2 = $value, !3 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      <const ast>
    6     2      > FE_RESET_R                                       $4      !0, ->17
          3    > > FE_FETCH_R                                       ~5      $4, !2, ->17
          4    >   ASSIGN                                                   !3, ~5
    7     5        TYPE_CHECK                                  128          !2
          6      > JMPZ                                                     ~7, ->12
    8     7    >   NEW                          self                $8      
          8        SEND_VAR_EX                                              !2
          9        SEND_VAR_EX                                              !1
         10        DO_FCALL                                      0          
         11        ASSIGN                                                   !2, $8
   10    12    >   INIT_METHOD_CALL                                         '_offsetSet'
         13        SEND_VAR_EX                                              !3
         14        SEND_VAR_EX                                              !2
         15        DO_FCALL                                      0          
    6    16      > JMP                                                      ->3
         17    >   FE_FREE                                                  $4
   13    18        INIT_METHOD_CALL                                         'setFlags'
         19        SEND_VAR_EX                                              !1
         20        DO_FCALL                                      0          
   14    21      > RETURN                                                   null

End of function __construct

Function _offsetset:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fqLRJ
function name:  _offsetSet
number of ops:  7
compiled vars:  !0 = $index, !1 = $newval
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   16     2        INIT_STATIC_METHOD_CALL                                  'offsetSet'
          3        SEND_VAR_EX                                              !0
          4        SEND_VAR_EX                                              !1
          5        DO_FCALL                                      0          
   17     6      > RETURN                                                   null

End of function _offsetset

Function offsetset:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fqLRJ
function name:  offsetSet
number of ops:  10
compiled vars:  !0 = $index, !1 = $newval
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   19     2        INIT_FCALL                                               'var_dump'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                                 
   20     5        INIT_METHOD_CALL                                         '_offsetSet'
          6        SEND_VAR                                                 !0
          7        SEND_VAR                                                 !1
          8        DO_FCALL                                      0          
   21     9      > RETURN                                                   null

End of function offsetset

Function __set:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 16
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fqLRJ
function name:  __set
number of ops:  21
compiled vars:  !0 = $name, !1 = $value, !2 = $flags
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   23     2        INIT_FCALL                                               'var_dump'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                                 
   24     5        INIT_FCALL                                               'var_dump'
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                                 
   25     8        TYPE_CHECK                                  128          !1
          9      > JMPZ                                                     ~5, ->16
   26    10    >   NEW                          self                $6      
         11        SEND_VAR_EX                                              !1
         12        SEND_VAR_EX                                              !2
         13        DO_FCALL                                      0          
         14        ASSIGN                                                   !1, $6
         15      > JMP                                                      ->20
   28    16    >   INIT_METHOD_CALL                                         'offsetSet'
         17        SEND_VAR_EX                                              !0
         18        SEND_VAR_EX                                              !1
         19        DO_FCALL                                      0          
   30    20    > > RETURN                                                   null

End of function __set

End of class RecursiveArrayObject.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.12 ms | 1408 KiB | 19 Q