3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Foo { protected $a = 0; public function test() { print $this->a = +1; } } class Bar { public function test() { print $this->a + 2; } } class Baz { public function test() { Foo::test(); } } $baz = new Baz; $baz->test();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ioZq3
function name:  (null)
number of ops:  6
compiled vars:  !0 = $baz
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   23     0  E >   NEW                                                  $1      'Baz'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $1
   24     3        INIT_METHOD_CALL                                             !0, 'test'
          4        DO_FCALL                                          0          
          5      > RETURN                                                       1

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

End of function test

End of class Foo.

Class Bar:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ioZq3
function name:  test
number of ops:  4
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   13     0  E >   FETCH_OBJ_R                                          ~0      'a'
          1        ADD                                                  ~1      ~0, 2
          2        ECHO                                                         ~1
   14     3      > RETURN                                                       null

End of function test

End of class Bar.

Class Baz:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ioZq3
function name:  test
number of ops:  3
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   19     0  E >   INIT_STATIC_METHOD_CALL                                      'Foo', 'test'
          1        DO_FCALL                                          0          
   20     2      > RETURN                                                       null

End of function test

End of class Baz.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
145.96 ms | 476 KiB | 7 Q