3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { private $x; public function __construct($x) { $this->x = $x; } public function printX() { var_dump($this->x); return $this; } } var_dump([]); $test = (new Test("Hello"))->printX(); var_dump($test);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JnqDc
function name:  (null)
number of ops:  13
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   INIT_FCALL                                               'var_dump'
          1        SEND_VAL                                                 <array>
          2        DO_ICALL                                                 
   13     3        NEW                                              $2      'Test'
          4        SEND_VAL_EX                                              'Hello'
          5        DO_FCALL                                      0          
          6        INIT_METHOD_CALL                                         $2, 'printX'
          7        DO_FCALL                                      0  $4      
          8        ASSIGN                                                   !0, $4
   15     9        INIT_FCALL                                               'var_dump'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                                 
         12      > RETURN                                                   1

Class Test:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JnqDc
function name:  __construct
number of ops:  4
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
          1        ASSIGN_OBJ                                               'x'
          2        OP_DATA                                                  !0
          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/JnqDc
function name:  printX
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   INIT_FCALL                                               'var_dump'
          1        FETCH_OBJ_R                                      ~0      'x'
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                                 
          4        FETCH_THIS                                       ~2      
          5      > RETURN                                                   ~2
          6*     > RETURN                                                   null

End of function printx

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.79 ms | 1401 KiB | 15 Q