3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private $bar = 'baz'; protected $baz = 'bar'; public function modify(){ $this->bar = 'bar'; $this->baz = 'baz'; } public function peek($target){ print 'Bar: '.$target->bar; print "\n".'Baz: '.$target->baz; } } $first = new Foo(); $second = new Foo(); $first->modify(); $second->peek($first);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dh6m8
function name:  (null)
number of ops:  12
compiled vars:  !0 = $first, !1 = $second
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   NEW                                              $2      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   18     3        NEW                                              $5      'Foo'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $5
   20     6        INIT_METHOD_CALL                                         !0, 'modify'
          7        DO_FCALL                                      0          
   21     8        INIT_METHOD_CALL                                         !1, 'peek'
          9        SEND_VAR_EX                                              !0
         10        DO_FCALL                                      0          
         11      > RETURN                                                   1

Class Foo:
Function modify:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dh6m8
function name:  modify
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   ASSIGN_OBJ                                               'bar'
          1        OP_DATA                                                  'bar'
    9     2        ASSIGN_OBJ                                               'baz'
          3        OP_DATA                                                  'baz'
   10     4      > RETURN                                                   null

End of function modify

Function peek:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dh6m8
function name:  peek
number of ops:  8
compiled vars:  !0 = $target
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   12     1        FETCH_OBJ_R                                      ~1      !0, 'bar'
          2        CONCAT                                           ~2      'Bar%3A+', ~1
          3        ECHO                                                     ~2
   13     4        FETCH_OBJ_R                                      ~3      !0, 'baz'
          5        CONCAT                                           ~4      '%0ABaz%3A+', ~3
          6        ECHO                                                     ~4
   14     7      > RETURN                                                   null

End of function peek

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.41 ms | 1386 KiB | 13 Q