3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { static public function getNew() { return new static; } } $obj1 = new Test(); $obj2 = new $obj1; var_dump($obj2);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MgP70
function name:  (null)
number of ops:  11
compiled vars:  !0 = $obj1, !1 = $obj2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   NEW                                              $2      'Test'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   11     3        FETCH_CLASS                                   0  $5      !0
          4        NEW                                              $6      $5
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !1, $6
   12     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Class Test:
Function getnew:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MgP70
function name:  getNew
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   NEW                          static              $0      
          1        DO_FCALL                                      0          
          2      > RETURN                                                   $0
    7     3*     > RETURN                                                   null

End of function getnew

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.48 ms | 1394 KiB | 15 Q