3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public $a = 0; public function printCount() { print $this -> a; print PHP_EOL; // print a new line. } } class B { public $b = 0; public function doSomethingWith( $a ) { $a -> a++; } } $a = new A(); $b = new B(); $a -> printCount(); $b -> doSomethingWith( $a ); $a -> printCount();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/23m5t
function name:  (null)
number of ops:  14
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   NEW                                              $2      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   26     3        NEW                                              $5      'B'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $5
   27     6        INIT_METHOD_CALL                                         !0, 'printCount'
          7        DO_FCALL                                      0          
   28     8        INIT_METHOD_CALL                                         !1, 'doSomethingWith'
          9        SEND_VAR_EX                                              !0
         10        DO_FCALL                                      0          
   29    11        INIT_METHOD_CALL                                         !0, 'printCount'
         12        DO_FCALL                                      0          
         13      > RETURN                                                   1

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

End of function printcount

End of class A.

Class B:
Function dosomethingwith:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/23m5t
function name:  doSomethingWith
number of ops:  3
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   RECV                                             !0      
   21     1        PRE_INC_OBJ                                              !0, 'a'
   22     2      > RETURN                                                   null

End of function dosomethingwith

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.35 ms | 1394 KiB | 13 Q