3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Parameters extends ArrayObject { public function __construct(array $values = null) { if (null === $values) { $values = array(); } parent::__construct($values, ArrayObject::ARRAY_AS_PROPS); } public function offsetGet($name) { if (isset($this[$name])) { return parent::offsetGet($name); } return null; } } $x = new Parameters(); var_dump($x['foo']); $x['foo'] = 'bar'; var_dump($x['foo']);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oAs01
function name:  (null)
number of ops:  14
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   NEW                                              $1      'Parameters'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   17     3        INIT_FCALL                                               'var_dump'
          4        FETCH_DIM_R                                      ~4      !0, 'foo'
          5        SEND_VAL                                                 ~4
          6        DO_ICALL                                                 
   18     7        ASSIGN_DIM                                               !0, 'foo'
          8        OP_DATA                                                  'bar'
   19     9        INIT_FCALL                                               'var_dump'
         10        FETCH_DIM_R                                      ~7      !0, 'foo'
         11        SEND_VAL                                                 ~7
         12        DO_ICALL                                                 
         13      > RETURN                                                   1

Class Parameters:
Function __construct:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 4
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
filename:       /in/oAs01
function name:  __construct
number of ops:  9
compiled vars:  !0 = $values
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV_INIT                                        !0      null
    4     1        TYPE_CHECK                                    2          !0
          2      > JMPZ                                                     ~1, ->4
    5     3    >   ASSIGN                                                   !0, <array>
    7     4    >   INIT_STATIC_METHOD_CALL                                  
          5        SEND_VAR_EX                                              !0
          6        SEND_VAL_EX                                              2
          7        DO_FCALL                                      0          
    8     8      > RETURN                                                   null

End of function __construct

Function offsetget:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 8
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oAs01
function name:  offsetGet
number of ops:  10
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
   10     1        FETCH_THIS                                       ~1      
          2        ISSET_ISEMPTY_DIM_OBJ                         0          ~1, !0
          3      > JMPZ                                                     ~2, ->8
   11     4    >   INIT_STATIC_METHOD_CALL                                  'offsetGet'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0  $3      
          7      > RETURN                                                   $3
   13     8    > > RETURN                                                   null
   14     9*     > RETURN                                                   null

End of function offsetget

End of class Parameters.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.29 ms | 945 KiB | 16 Q