3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private $message; public function __construct($msg) { $this->message = $msg; } public function test() { if (isset($this)) { $this->show(); } else { $o = new self('bar'); $o->show(); } } public function show() { echo 'show: ', $this->message, "\n"; } } $o = new A('foo'); $o->test(); A::test();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WaYrB
function name:  (null)
number of ops:  9
compiled vars:  !0 = $o
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   NEW                                              $1      'A'
          1        SEND_VAL_EX                                              'foo'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   27     4        INIT_METHOD_CALL                                         !0, 'test'
          5        DO_FCALL                                      0          
   29     6        INIT_STATIC_METHOD_CALL                                  'A', 'test'
          7        DO_FCALL                                      0          
          8      > RETURN                                                   1

Class A:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WaYrB
function name:  __construct
number of ops:  4
compiled vars:  !0 = $msg
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    8     1        ASSIGN_OBJ                                               'message'
          2        OP_DATA                                                  !0
    9     3      > RETURN                                                   null

End of function __construct

Function test:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 2, Position 2 = 5
Branch analysis from position: 2
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WaYrB
function name:  test
number of ops:  12
compiled vars:  !0 = $o
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   ISSET_ISEMPTY_THIS                               ~1      
          1      > JMPZ                                                     ~1, ->5
   14     2    >   INIT_METHOD_CALL                                         'show'
          3        DO_FCALL                                      0          
          4      > JMP                                                      ->11
   16     5    >   NEW                          self                $3      
          6        SEND_VAL_EX                                              'bar'
          7        DO_FCALL                                      0          
          8        ASSIGN                                                   !0, $3
   17     9        INIT_METHOD_CALL                                         !0, 'show'
         10        DO_FCALL                                      0          
   19    11    > > RETURN                                                   null

End of function test

Function show:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WaYrB
function name:  show
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   ECHO                                                     'show%3A+'
          1        FETCH_OBJ_R                                      ~0      'message'
          2        ECHO                                                     ~0
          3        ECHO                                                     '%0A'
   23     4      > RETURN                                                   null

End of function show

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
178.65 ms | 1403 KiB | 13 Q