3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = new stdClass; $a->val = 2; function func(stdClass $obj) { $val = 5; return $obj->val = $val = 5; } echo "func() returns: "; var_dump(func($a)); echo "\n\$a->val is now: "; var_dump($a->val);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mldTf
function name:  (null)
number of ops:  18
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $1      'stdClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
    4     3        ASSIGN_OBJ                                               !0, 'val'
          4        OP_DATA                                                  2
   11     5        ECHO                                                     'func%28%29+returns%3A+'
   12     6        INIT_FCALL                                               'var_dump'
          7        INIT_FCALL                                               'func'
          8        SEND_VAR                                                 !0
          9        DO_FCALL                                      0  $5      
         10        SEND_VAR                                                 $5
         11        DO_ICALL                                                 
   13    12        ECHO                                                     '%0A%24a-%3Eval+is+now%3A+'
   14    13        INIT_FCALL                                               'var_dump'
         14        FETCH_OBJ_R                                      ~7      !0, 'val'
         15        SEND_VAL                                                 ~7
         16        DO_ICALL                                                 
         17      > RETURN                                                   1

Function func:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mldTf
function name:  func
number of ops:  7
compiled vars:  !0 = $obj, !1 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    7     1        ASSIGN                                                   !1, 5
    8     2        ASSIGN                                           ~4      !1, 5
          3        ASSIGN_OBJ                                       ~3      !0, 'val'
          4        OP_DATA                                                  ~4
          5      > RETURN                                                   ~3
    9     6*     > RETURN                                                   null

End of function func

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.29 ms | 1398 KiB | 16 Q