3v4l.org

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

Class A:
Function offsetget:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/SbMuT
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      'Error'
          2        DO_FCALL                                      0          
          3      > THROW                                         0          $1
    7     4*     > RETURN                                                   null

End of function offsetget

Function offsetexists:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SbMuT
function name:  offsetExists
number of ops:  4
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
   10     1        ECHO                                                     'noooooooooo'
   11     2      > RETURN                                                   <false>
   12     3*     > 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/SbMuT
function name:  offsetSet
number of ops:  3
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     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/SbMuT
function name:  offsetUnset
number of ops:  2
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     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:
171.39 ms | 1400 KiB | 15 Q