3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A implements ArrayAccess { function offsetGet($a){ return new A; } function offsetExists($a){ echo "exists"; if($a === 10){ return true; }else{ return false; } } function offsetSet($a, $b){} function offsetUnset($a){} } $x = new A; var_dump($x[10][20] ?? 20);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fU7LA
function name:  (null)
number of ops:  12
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'a'
   23     1        NEW                                              $1      'A'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   25     4        INIT_FCALL                                               'var_dump'
          5        FETCH_DIM_IS                                     ~4      !0, 10
          6        FETCH_DIM_IS                                     ~5      ~4, 20
          7        COALESCE                                         ~6      ~5
          8        QM_ASSIGN                                        ~6      20
          9        SEND_VAL                                                 ~6
         10        DO_ICALL                                                 
         11      > RETURN                                                   1

Class A:
Function offsetget:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fU7LA
function name:  offsetGet
number of ops:  5
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        NEW                                              $1      'A'
          2        DO_FCALL                                      0          
          3      > RETURN                                                   $1
    7     4*     > RETURN                                                   null

End of function offsetget

Function offsetexists:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fU7LA
function name:  offsetExists
number of ops:  8
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
   10     1        ECHO                                                     'exists'
   11     2        IS_IDENTICAL                                             !0, 10
          3      > JMPZ                                                     ~1, ->6
   12     4    > > RETURN                                                   <true>
   11     5*       JMP                                                      ->7
   14     6    > > RETURN                                                   <false>
   16     7*     > RETURN                                                   null

End of function offsetexists

Function offsetset:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fU7LA
function name:  offsetSet
number of ops:  3
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     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/fU7LA
function name:  offsetUnset
number of ops:  2
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   RECV                                             !0      
          1      > RETURN                                                   null

End of function offsetunset

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.25 ms | 1003 KiB | 14 Q