3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Test { private $x = 123; public function __construct($x) { $this->x = $x; } public function printX($test) { print $test->x; } } $test1 = new Test(123); $test2 = new Test(345); $test1->printX($test2);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HqEko
function name:  (null)
number of ops:  12
compiled vars:  !0 = $test1, !1 = $test2
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   18     0  E >   NEW                                                  $2      'Test'
          1        SEND_VAL_EX                                                  123
          2        DO_FCALL                                          0          
          3        ASSIGN                                                       !0, $2
   19     4        NEW                                                  $5      'Test'
          5        SEND_VAL_EX                                                  345
          6        DO_FCALL                                          0          
          7        ASSIGN                                                       !1, $5
   21     8        INIT_METHOD_CALL                                             !0, 'printX'
          9        SEND_VAR_EX                                                  !1
         10        DO_FCALL                                          0          
         11      > RETURN                                                       1

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

End of function __construct

Function printx:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HqEko
function name:  printX
number of ops:  4
compiled vars:  !0 = $test
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   12     0  E >   RECV                                                 !0      
   14     1        FETCH_OBJ_R                                          ~1      !0, 'x'
          2        ECHO                                                         ~1
   15     3      > RETURN                                                       null

End of function printx

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
164.96 ms | 1996 KiB | 13 Q