3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { final protected function __clone() {} } class B extends A { // this should probably not be legal function copy() { return clone $this; } } var_dump((new B)->copy());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qupHR
function name:  (null)
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   INIT_FCALL                                               'var_dump'
          1        NEW                                              $0      'B'
          2        DO_FCALL                                      0          
          3        INIT_METHOD_CALL                                         $0, 'copy'
          4        DO_FCALL                                      0  $2      
          5        SEND_VAR                                                 $2
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

Class A:
Function __clone:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qupHR
function name:  __clone
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E > > RETURN                                                   null

End of function __clone

End of class A.

Class B:
Function copy:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qupHR
function name:  copy
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   FETCH_THIS                                       ~0      
          1        CLONE                                            ~1      ~0
          2      > RETURN                                                   ~1
          3*     > RETURN                                                   null

End of function copy

Function __clone:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qupHR
function name:  __clone
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E > > RETURN                                                   null

End of function __clone

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.89 ms | 1395 KiB | 15 Q