3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Obj { public $values = []; public function __set($name, $value) { $this->values[$name] = $value; } } class Arr implements ArrayAccess { public $values = []; public function offsetSet($name, $value) { $this->values[$name] = $value; } public function offsetGet($name) {} public function offsetExists($name) {} public function offsetUnset($name) {} } $str = 'ab'; list($str[0], $str[1]) = ['x', 'y']; var_dump($str); $obj = new Obj; list($obj->foo, $obj->bar) = ['foo', 'bar']; var_dump($obj->values); $arr = new Arr; list($arr['foo'], $arr['bar']) = ['foo', 'bar']; var_dump($arr->values);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sqXmT
function name:  (null)
number of ops:  38
compiled vars:  !0 = $str, !1 = $obj, !2 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   DECLARE_CLASS                                            'arr'
   20     1        ASSIGN                                                   !0, 'ab'
   21     2        FETCH_LIST_R                                     $4      <array>, 0
          3        ASSIGN_DIM                                               !0, 0
          4        OP_DATA                                                  $4
          5        FETCH_LIST_R                                     $6      <array>, 1
          6        ASSIGN_DIM                                               !0, 1
          7        OP_DATA                                                  $6
   22     8        INIT_FCALL                                               'var_dump'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                                 
   24    11        NEW                                              $9      'Obj'
         12        DO_FCALL                                      0          
         13        ASSIGN                                                   !1, $9
   25    14        FETCH_LIST_R                                     $12     <array>, 0
         15        ASSIGN_OBJ                                               !1, 'foo'
         16        OP_DATA                                                  $12
         17        FETCH_LIST_R                                     $14     <array>, 1
         18        ASSIGN_OBJ                                               !1, 'bar'
         19        OP_DATA                                                  $14
   26    20        INIT_FCALL                                               'var_dump'
         21        FETCH_OBJ_R                                      ~16     !1, 'values'
         22        SEND_VAL                                                 ~16
         23        DO_ICALL                                                 
   28    24        NEW                                              $18     'Arr'
         25        DO_FCALL                                      0          
         26        ASSIGN                                                   !2, $18
   29    27        FETCH_LIST_R                                     $21     <array>, 0
         28        ASSIGN_DIM                                               !2, 'foo'
         29        OP_DATA                                                  $21
         30        FETCH_LIST_R                                     $23     <array>, 1
         31        ASSIGN_DIM                                               !2, 'bar'
         32        OP_DATA                                                  $23
   30    33        INIT_FCALL                                               'var_dump'
         34        FETCH_OBJ_R                                      ~25     !2, 'values'
         35        SEND_VAL                                                 ~25
         36        DO_ICALL                                                 
         37      > RETURN                                                   1

Class Obj:
Function __set:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sqXmT
function name:  __set
number of ops:  6
compiled vars:  !0 = $name, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    6     2        FETCH_OBJ_W                                      $2      'values'
          3        ASSIGN_DIM                                               $2, !0
          4        OP_DATA                                                  !1
    7     5      > RETURN                                                   null

End of function __set

End of class Obj.

Class Arr:
Function offsetset:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sqXmT
function name:  offsetSet
number of ops:  6
compiled vars:  !0 = $name, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   13     2        FETCH_OBJ_W                                      $2      'values'
          3        ASSIGN_DIM                                               $2, !0
          4        OP_DATA                                                  !1
   14     5      > RETURN                                                   null

End of function offsetset

Function offsetget:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sqXmT
function name:  offsetGet
number of ops:  2
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
          1      > 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/sqXmT
function name:  offsetExists
number of ops:  2
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   RECV                                             !0      
          1      > RETURN                                                   null

End of function offsetexists

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

End of function offsetunset

End of class Arr.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.13 ms | 1400 KiB | 15 Q