3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arrayData = new class implements \ArrayAccess { public function offsetExists($offset) { echo "offsetExists\n"; } public function offsetGet($offset) { echo "offsetGet\n"; } public function offsetSet($offset, $value) { } public function offsetUnset($offset) { } }; echo "arrayData - isset:\n"; isset($arrayData['foo']) ? NULL : NULL; echo "arrayData - null coalescing operator:\n"; $arrayData['foo'] ?? NULL; $fixedData = new class extends \SplFixedArray { public function offsetExists($offset) { echo "offsetExists\n"; } public function offsetGet($offset) { echo "offsetGet\n"; } public function offsetSet($offset, $value) { } public function offsetUnset($offset) { } }; echo "fixedData - isset:\n"; isset($fixedData['foo']) ? NULL : NULL; echo "fixedData - null coalescing operator:\n"; $fixedData['foo'] ?? NULL;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 9
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 25
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 25
Branch analysis from position: 23
Branch analysis from position: 25
filename:       /in/BudKa
function name:  (null)
number of ops:  33
compiled vars:  !0 = $arrayData, !1 = $fixedData
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   VERIFY_ABSTRACT_CLASS                            $2      'class%40anonymous%00%2Fin%2Fbudka0x7f1a8f47a122'
         1        NEW                                              $3      :2
         2        DO_FCALL                                      0          
         3        QM_ASSIGN                                                !0
  26     4        ASSIGN_OBJ                                               'arrayData+-+isset%3A%0A'
  27     5        ISSET_ISEMPTY_DIM_OBJ                         0  ~6      !0, 'foo'
         6      > JMPZ                                                     ~6, ->9
         7    >   ASSIGN_BW_OR                                  0  ~7      null
         8      > JMP                                                      ->10
         9    >   ASSIGN_BW_OR                                  0  ~7      null
        10    >   FREE                                                     ~7
  28    11        ASSIGN_OBJ                                               'arrayData+-+null+coalescing+operator%3A%0A'
  29    12        FETCH_DIM_IS                                     ~8      !0, 'foo'
        13        COALESCE                                         ~9      ~8
        14        ASSIGN_BW_OR                                  0  ~9      null
        15        FREE                                                     ~9
  32    16        VERIFY_ABSTRACT_CLASS                            $10     'class%40anonymous%00%2Fin%2Fbudka0x7f1a8f47a2d2', 'splfixedarray'
        17        NEW                                              $11     :10
        18        DO_FCALL                                      0          
        19        QM_ASSIGN                                                !1
  56    20        ASSIGN_OBJ                                               'fixedData+-+isset%3A%0A'
  57    21        ISSET_ISEMPTY_DIM_OBJ                         0  ~14     !1, 'foo'
        22      > JMPZ                                                     ~14, ->25
        23    >   ASSIGN_BW_OR                                  0  ~15     null
        24      > JMP                                                      ->26
        25    >   ASSIGN_BW_OR                                  0  ~15     null
        26    >   FREE                                                     ~15
  58    27        ASSIGN_OBJ                                               'fixedData+-+null+coalescing+operator%3A%0A'
  59    28        FETCH_DIM_IS                                     ~16     !1, 'foo'
        29        COALESCE                                         ~17     ~16
        30        ASSIGN_BW_OR                                  0  ~17     null
        31        FREE                                                     ~17
        32      > RETURN                                                   1

Class class@anonymous:
Function offsetexists:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BudKa
function name:  offsetExists
number of ops:  3
compiled vars:  !0 = $offset
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   5     0  E >   RECV                                             !0      
   7     1        ASSIGN_OBJ                                               'offsetExists%0A'
   8     2      > 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/BudKa
function name:  offsetGet
number of ops:  3
compiled vars:  !0 = $offset
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  11     0  E >   RECV                                             !0      
  13     1        ASSIGN_OBJ                                               'offsetGet%0A'
  14     2      > 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/BudKa
function name:  offsetSet
number of ops:  3
compiled vars:  !0 = $offset, !1 = $value
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  17     0  E >   RECV                                             !0      
         1        RECV                                             !1      
  19     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/BudKa
function name:  offsetUnset
number of ops:  2
compiled vars:  !0 = $offset
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  22     0  E >   RECV                                             !0      
  24     1      > RETURN                                                   null

End of function offsetunset

End of class class@anonymous.

Class class@anonymous:
Function offsetexists:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BudKa
function name:  offsetExists
number of ops:  3
compiled vars:  !0 = $offset
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  34     0  E >   RECV                                             !0      
  36     1        ASSIGN_OBJ                                               'offsetExists%0A'
  37     2      > 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/BudKa
function name:  offsetGet
number of ops:  3
compiled vars:  !0 = $offset
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  40     0  E >   RECV                                             !0      
  42     1        ASSIGN_OBJ                                               'offsetGet%0A'
  43     2      > 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/BudKa
function name:  offsetSet
number of ops:  3
compiled vars:  !0 = $offset, !1 = $value
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  46     0  E >   RECV                                             !0      
         1        RECV                                             !1      
  48     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/BudKa
function name:  offsetUnset
number of ops:  2
compiled vars:  !0 = $offset
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  51     0  E >   RECV                                             !0      
  53     1      > RETURN                                                   null

End of function offsetunset

End of class class@anonymous.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
45.63 ms | 420 KiB | 7 Q