3v4l.org

run code in 300+ PHP versions simultaneously
<?php class User { public function __construct($user) { echo 'I am user ', $user; } public function __clone() { echo 'I am a cloned user'; } } $user1 = new User('John'); $user2 = $user1->__clone(); var_dump($user2);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hTYbP
function name:  (null)
number of ops:  11
compiled vars:  !0 = $user1, !1 = $user2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   NEW                                              $2      'User'
          1        SEND_VAL_EX                                              'John'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
   19     4        INIT_METHOD_CALL                                         !0, '__clone'
          5        DO_FCALL                                      0  $5      
          6        ASSIGN                                                   !1, $5
   21     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Class User:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hTYbP
function name:  __construct
number of ops:  4
compiled vars:  !0 = $user
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    7     1        ECHO                                                     'I+am+user+'
          2        ECHO                                                     !0
    8     3      > RETURN                                                   null

End of function __construct

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

End of function __clone

End of class User.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.43 ms | 1395 KiB | 15 Q