3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { final private function __clone() { raise_error("Trying to clone an uncloneable object of class Exception", E_ERROR); } } $x = new A; var_dump($x); var_dump(clone $x); //var_dump(clone new A; var_dump(clone new Exception);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3JrUF
function name:  (null)
number of ops:  17
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   NEW                                              $1      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   12     3        INIT_FCALL                                               'var_dump'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                                 
   13     6        INIT_FCALL                                               'var_dump'
          7        CLONE                                            ~5      !0
          8        SEND_VAL                                                 ~5
          9        DO_ICALL                                                 
   15    10        INIT_FCALL                                               'var_dump'
         11        NEW                                              $7      'Exception'
         12        DO_FCALL                                      0          
         13        CLONE                                            ~9      $7
         14        SEND_VAL                                                 ~9
         15        DO_ICALL                                                 
         16      > RETURN                                                   1

Class A:
Function __clone:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3JrUF
function name:  __clone
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   INIT_FCALL_BY_NAME                                       'raise_error'
          1        SEND_VAL_EX                                              'Trying+to+clone+an+uncloneable+object+of+class+Exception'
          2        SEND_VAL_EX                                              1
          3        DO_FCALL                                      0          
    7     4      > RETURN                                                   null

End of function __clone

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.25 ms | 1395 KiB | 15 Q