3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(E_ALL - E_STRICT); class A { private $message; public function __construct($msg) { $this->message = $msg; } public function test() { $self = 'this'; if (isset($this) === false) { $$self = new self('bar'); } $$self->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/mZuCL
function name:  (null)
number of ops:  12
compiled vars:  !0 = $o
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'error_reporting'
          1        SEND_VAL                                                 30719
          2        DO_ICALL                                                 
   26     3        NEW                                              $2      'A'
          4        SEND_VAL_EX                                              'foo'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !0, $2
   27     7        INIT_METHOD_CALL                                         !0, 'test'
          8        DO_FCALL                                      0          
   29     9        INIT_STATIC_METHOD_CALL                                  'A', 'test'
         10        DO_FCALL                                      0          
         11      > RETURN                                                   1

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

End of function __construct

Function test:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 9
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
filename:       /in/mZuCL
function name:  test
number of ops:  13
compiled vars:  !0 = $self
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   ASSIGN                                                   !0, 'this'
   15     1        ISSET_ISEMPTY_THIS                               ~2      
          2        TYPE_CHECK                                    4          ~2
          3      > JMPZ                                                     ~3, ->9
   16     4    >   NEW                          self                $5      
          5        SEND_VAL_EX                                              'bar'
          6        DO_FCALL                                      0          
          7        FETCH_W                      local               $4      !0
          8        ASSIGN                                                   $4, $5
   18     9    >   FETCH_R                      local               ~8      !0
         10        INIT_METHOD_CALL                                         ~8, 'show'
         11        DO_FCALL                                      0          
   19    12      > 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/mZuCL
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:
160.26 ms | 1404 KiB | 15 Q