3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private $isTrue = true; function foo() { echo 'foo'; $this->isTrue = false; } function bar() { echo 'bar'; } function baz() { if ($this->isTrue) { $this->foo(); } if (!$this->isTrue) { $this->bar(); } } } (new Foo)->baz();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/W2DMAb
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   NEW                                              $0      'Foo'
          1        DO_FCALL                                      0          
          2        INIT_METHOD_CALL                                         $0, 'baz'
          3        DO_FCALL                                      0          
          4      > RETURN                                                   1

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

End of function foo

Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/W2DMAb
function name:  bar
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   ECHO                                                     'bar'
   15     1      > RETURN                                                   null

End of function bar

Function baz:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 2, Position 2 = 4
Branch analysis from position: 2
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 9
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
Branch analysis from position: 4
filename:       /in/W2DMAb
function name:  baz
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   FETCH_OBJ_R                                      ~0      'isTrue'
          1      > JMPZ                                                     ~0, ->4
   19     2    >   INIT_METHOD_CALL                                         'foo'
          3        DO_FCALL                                      0          
   21     4    >   FETCH_OBJ_R                                      ~2      'isTrue'
          5        BOOL_NOT                                         ~3      ~2
          6      > JMPZ                                                     ~3, ->9
   22     7    >   INIT_METHOD_CALL                                         'bar'
          8        DO_FCALL                                      0          
   24     9    > > RETURN                                                   null

End of function baz

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.82 ms | 1395 KiB | 13 Q