3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ArrayExtended implements ArrayAccess{ protected $ary = array(); public function __construct(array $a = null) { if($a) $this->ary = $a; } // Useful methods public function reverse() { $this->ary = array_reverse($this->ary); return $this; } // Mandatory methods for ArrayAccess implementation public function offsetExists($off){} public function offsetGet($off){} public function offsetSet($off,$val){} public function offsetUnset($off){} } $o = new ArrayExtended(array('a','b')); $o[] = 'c'; print_r($o);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/G60pk
function name:  (null)
number of ops:  11
compiled vars:  !0 = $o
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'arrayextended'
   24     1        NEW                                              $1      'ArrayExtended'
          2        SEND_VAL_EX                                              <array>
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $1
   25     5        ASSIGN_DIM                                               !0
          6        OP_DATA                                                  'c'
   26     7        INIT_FCALL                                               'print_r'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Class ArrayExtended:
Function __construct:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 2, Position 2 = 4
Branch analysis from position: 2
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
filename:       /in/G60pk
function name:  __construct
number of ops:  5
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV_INIT                                        !0      null
    7     1      > JMPZ                                                     !0, ->4
          2    >   ASSIGN_OBJ                                               'ary'
          3        OP_DATA                                                  !0
    8     4    > > RETURN                                                   null

End of function __construct

Function reverse:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/G60pk
function name:  reverse
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   INIT_FCALL                                               'array_reverse'
          1        FETCH_OBJ_R                                      ~1      'ary'
          2        SEND_VAL                                                 ~1
          3        DO_ICALL                                         $2      
          4        ASSIGN_OBJ                                               'ary'
          5        OP_DATA                                                  $2
   13     6        FETCH_THIS                                       ~3      
          7      > RETURN                                                   ~3
   14     8*     > RETURN                                                   null

End of function reverse

Function offsetexists:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/G60pk
function name:  offsetExists
number of ops:  2
compiled vars:  !0 = $off
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
          1      > RETURN                                                   null

End of function offsetexists

Function offsetget:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/G60pk
function name:  offsetGet
number of ops:  2
compiled vars:  !0 = $off
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   RECV                                             !0      
          1      > RETURN                                                   null

End of function offsetget

Function offsetset:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/G60pk
function name:  offsetSet
number of ops:  3
compiled vars:  !0 = $off, !1 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2      > RETURN                                                   null

End of function offsetset

Function offsetunset:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/G60pk
function name:  offsetUnset
number of ops:  2
compiled vars:  !0 = $off
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   RECV                                             !0      
          1      > RETURN                                                   null

End of function offsetunset

End of class ArrayExtended.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.5 ms | 1392 KiB | 17 Q