3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { static public function getNew() { return new static; } } class Child extends Test {} $obj1 = new Test(); $obj2 = new $obj1; var_dump($obj1 !== $obj2); $obj3 = Test::getNew(); var_dump($obj3 instanceof Test); $obj4 = Child::getNew(); var_dump($obj4 instanceof Child); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/36fGm
function name:  (null)
number of ops:  26
compiled vars:  !0 = $obj1, !1 = $obj2, !2 = $obj3, !3 = $obj4
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   NEW                                              $4      'Test'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $4
   14     3        FETCH_CLASS                                   0  $7      !0
          4        NEW                                              $8      $7
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !1, $8
   15     7        INIT_FCALL                                               'var_dump'
          8        IS_NOT_IDENTICAL                                 ~11     !0, !1
          9        SEND_VAL                                                 ~11
         10        DO_ICALL                                                 
   17    11        INIT_STATIC_METHOD_CALL                                  'Test', 'getNew'
         12        DO_FCALL                                      0  $13     
         13        ASSIGN                                                   !2, $13
   18    14        INIT_FCALL                                               'var_dump'
         15        INSTANCEOF                                       ~15     !2, 'Test'
         16        SEND_VAL                                                 ~15
         17        DO_ICALL                                                 
   20    18        INIT_STATIC_METHOD_CALL                                  'Child', 'getNew'
         19        DO_FCALL                                      0  $17     
         20        ASSIGN                                                   !3, $17
   21    21        INIT_FCALL                                               'var_dump'
         22        INSTANCEOF                                       ~19     !3, 'Child'
         23        SEND_VAL                                                 ~19
         24        DO_ICALL                                                 
   22    25      > RETURN                                                   1

Class Test:
Function getnew:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/36fGm
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.

Class Child:
Function getnew:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/36fGm
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 Child.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
128.84 ms | 1401 KiB | 15 Q