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; } } $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/4Nuv3
function name:  (null)
number of ops:  10
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   NEW                                              $1      'Test'
          1        SEND_VAL_EX                                              'Hello'
          2        DO_FCALL                                      0          
          3        INIT_METHOD_CALL                                         $1, 'printX'
          4        DO_FCALL                                      0  $3      
          5        ASSIGN                                                   !0, $3
   13     6        INIT_FCALL                                               'var_dump'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

Class Test:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4Nuv3
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/4Nuv3
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:
169.04 ms | 1387 KiB | 15 Q