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 Foo::$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/Yv79N
function name:  (null)
number of ops:  15
compiled vars:  !0 = $foo1, !1 = $foo2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   29     0  E >   NEW                                              $2      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   31     3        INIT_METHOD_CALL                                         !0, 'sayHello'
          4        DO_FCALL                                      0          
   34     5        NEW                                              $6      'Foo'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $6
   36     8        INIT_METHOD_CALL                                         !1, 'sayHello'
          9        DO_FCALL                                      0          
   38    10        INIT_METHOD_CALL                                         !0, 'getNumber'
         11        DO_FCALL                                      0          
   40    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/Yv79N
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/Yv79N
function name:  getNumber
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   FETCH_STATIC_PROP_R          unknown             ~0      'person'
          1      > RETURN                                                   ~0
   18     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/Yv79N
function name:  __constructor
number of ops:  5
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   RECV                                             !0      
   25     1        FETCH_CLASS                                   0  $1      !0
          2        INIT_STATIC_METHOD_CALL                                  $1, 'sayHello'
          3        DO_FCALL                                      0          
   26     4      > RETURN                                                   null

End of function __constructor

End of class Bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150 ms | 1395 KiB | 13 Q