3v4l.org

run code in 300+ PHP versions simultaneously
<?php class User{ public $username; public $email; private $parse = 'phpinfo'; public $canonicalname; function __construct($username,$email){ $this->username = $username; $this->email = $email; //check username $parse = $this->parse; $this->canonicalname = $parse(); } public function __wakeup() { //make sure object is safe to use $parse = $this->parse; $this->canonicalname = $parse(); } } $user = new User('hugo', 'email'); var_dump(serialize($user));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/r9QiM
function name:  (null)
number of ops:  12
compiled vars:  !0 = $user
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   NEW                                              $1      'User'
          1        SEND_VAL_EX                                              'hugo'
          2        SEND_VAL_EX                                              'email'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $1
   25     5        INIT_FCALL                                               'var_dump'
          6        INIT_FCALL                                               'serialize'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $4      
          9        SEND_VAR                                                 $4
         10        DO_ICALL                                                 
         11      > RETURN                                                   1

Class User:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/r9QiM
function name:  __construct
number of ops:  13
compiled vars:  !0 = $username, !1 = $email, !2 = $parse
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    9     2        ASSIGN_OBJ                                               'username'
          3        OP_DATA                                                  !0
   10     4        ASSIGN_OBJ                                               'email'
          5        OP_DATA                                                  !1
   12     6        FETCH_OBJ_R                                      ~5      'parse'
          7        ASSIGN                                                   !2, ~5
   13     8        INIT_DYNAMIC_CALL                                        !2
          9        DO_FCALL                                      0  $8      
         10        ASSIGN_OBJ                                               'canonicalname'
         11        OP_DATA                                                  $8
   14    12      > RETURN                                                   null

End of function __construct

Function __wakeup:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/r9QiM
function name:  __wakeup
number of ops:  7
compiled vars:  !0 = $parse
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   FETCH_OBJ_R                                      ~1      'parse'
          1        ASSIGN                                                   !0, ~1
   18     2        INIT_DYNAMIC_CALL                                        !0
          3        DO_FCALL                                      0  $4      
          4        ASSIGN_OBJ                                               'canonicalname'
          5        OP_DATA                                                  $4
   19     6      > RETURN                                                   null

End of function __wakeup

End of class User.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.01 ms | 1388 KiB | 17 Q