3v4l.org

run code in 300+ PHP versions simultaneously
<?php class foo {} class bar {} class Thing { public $ret = 'foo'; public function get() { return new $this->ret; } } $t = new Thing; $t->ret = 'bar'; $test = $t->get(); var_dump(get_class($test));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SNuau
function name:  (null)
number of ops:  13
compiled vars:  !0 = $t, !1 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   NEW                                              $2      'Thing'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   16     3        ASSIGN_OBJ                                               !0, 'ret'
          4        OP_DATA                                                  'bar'
   18     5        INIT_METHOD_CALL                                         !0, 'get'
          6        DO_FCALL                                      0  $6      
          7        ASSIGN                                                   !1, $6
   20     8        INIT_FCALL                                               'var_dump'
          9        GET_CLASS                                        ~8      !1
         10        SEND_VAL                                                 ~8
         11        DO_ICALL                                                 
         12      > RETURN                                                   1

Class foo: [no user functions]
Class bar: [no user functions]
Class Thing:
Function get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SNuau
function name:  get
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   FETCH_OBJ_R                                      ~0      'ret'
          1        FETCH_CLASS                                   0  $1      ~0
          2        NEW                                              $2      $1
          3        DO_FCALL                                      0          
          4      > RETURN                                                   $2
   11     5*     > RETURN                                                   null

End of function get

End of class Thing.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.25 ms | 1395 KiB | 15 Q