3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { private $testy; function __construct($input) { $this->testy = $input; } public function doSomething() { return $this->testy * mt_rand(); } } $obj = new Test(1); echo $obj->doSomething();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HAVen
function name:  (null)
number of ops:  8
compiled vars:  !0 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   NEW                                              $1      'Test'
          1        SEND_VAL_EX                                              1
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   16     4        INIT_METHOD_CALL                                         !0, 'doSomething'
          5        DO_FCALL                                      0  $4      
          6        ECHO                                                     $4
          7      > RETURN                                                   1

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

End of function __construct

Function dosomething:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HAVen
function name:  doSomething
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   FETCH_OBJ_R                                      ~0      'testy'
          1        INIT_FCALL                                               'mt_rand'
          2        DO_ICALL                                         $1      
          3        MUL                                              ~2      $1, ~0
          4      > RETURN                                                   ~2
   12     5*     > RETURN                                                   null

End of function dosomething

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
136.15 ms | 1395 KiB | 15 Q