3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public static $person; public function sayHello() { $person += 1; echo 'Hello'; } public function getNumber(){ return $this->person; } } class Bar { public function __constructor($foo) { $foo::sayHello(); } } $foo1 = new Foo(); $foo1->sayHello(); $foo2 = new Foo(); $foo2->sayHello(); $foo1->getNumber(); $foo2->getNumber();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MNRCm
function name:  (null)
number of ops:  15
compiled vars:  !0 = $foo1, !1 = $foo2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   30     0  E >   NEW                                              $2      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   32     3        INIT_METHOD_CALL                                         !0, 'sayHello'
          4        DO_FCALL                                      0          
   35     5        NEW                                              $6      'Foo'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $6
   37     8        INIT_METHOD_CALL                                         !1, 'sayHello'
          9        DO_FCALL                                      0          
   39    10        INIT_METHOD_CALL                                         !0, 'getNumber'
         11        DO_FCALL                                      0          
   41    12        INIT_METHOD_CALL                                         !1, 'getNumber'
         13        DO_FCALL                                      0          
         14      > RETURN                                                   1

Class Foo:
Function sayhello:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MNRCm
function name:  sayHello
number of ops:  3
compiled vars:  !0 = $person
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   ASSIGN_OP                                     1          !0, 1
   11     1        ECHO                                                     'Hello'
   12     2      > RETURN                                                   null

End of function sayhello

Function getnumber:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MNRCm
function name:  getNumber
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   FETCH_OBJ_R                                      ~0      'person'
          1      > RETURN                                                   ~0
   19     2*     > RETURN                                                   null

End of function getnumber

End of class Foo.

Class Bar:
Function __constructor:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MNRCm
function name:  __constructor
number of ops:  5
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   RECV                                             !0      
   26     1        FETCH_CLASS                                   0  $1      !0
          2        INIT_STATIC_METHOD_CALL                                  $1, 'sayHello'
          3        DO_FCALL                                      0          
   27     4      > RETURN                                                   null

End of function __constructor

End of class Bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.55 ms | 1395 KiB | 13 Q