3v4l.org

run code in 300+ PHP versions simultaneously
<?php class User { public string $name = ""; public string $password = ""; public int $admin = 0; public string $fullName = ""; public function __construct(string $name, string $password, int $admin) { $this->name = $name; $this->password= $password; $this->admin = $admin; } public function __wakeup() { $this->fullName = $this->name . $this->password; } } $user_test = new User("Sebastian", "Password", 1); var_dump($user_test); var_dump(serialize($user_test)); $other_user = unserialize('O:4:"User":3:{s:4:"name";s:9:"Sebastian";s:8:"password";s:8:"Password";s:5:"admin";i:2;}'); var_dump($other_user);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/N3a1U
function name:  (null)
number of ops:  23
compiled vars:  !0 = $user_test, !1 = $other_user
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   NEW                                              $2      'User'
          1        SEND_VAL_EX                                              'Sebastian'
          2        SEND_VAL_EX                                              'Password'
          3        SEND_VAL_EX                                              1
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $2
   25     6        INIT_FCALL                                               'var_dump'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                                 
   26     9        INIT_FCALL                                               'var_dump'
         10        INIT_FCALL                                               'serialize'
         11        SEND_VAR                                                 !0
         12        DO_ICALL                                         $6      
         13        SEND_VAR                                                 $6
         14        DO_ICALL                                                 
   28    15        INIT_FCALL                                               'unserialize'
         16        SEND_VAL                                                 'O%3A4%3A%22User%22%3A3%3A%7Bs%3A4%3A%22name%22%3Bs%3A9%3A%22Sebastian%22%3Bs%3A8%3A%22password%22%3Bs%3A8%3A%22Password%22%3Bs%3A5%3A%22admin%22%3Bi%3A2%3B%7D'
         17        DO_ICALL                                         $8      
         18        ASSIGN                                                   !1, $8
   30    19        INIT_FCALL                                               'var_dump'
         20        SEND_VAR                                                 !1
         21        DO_ICALL                                                 
         22      > RETURN                                                   1

Class User:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/N3a1U
function name:  __construct
number of ops:  10
compiled vars:  !0 = $name, !1 = $password, !2 = $admin
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
   12     3        ASSIGN_OBJ                                               'name'
          4        OP_DATA                                                  !0
   13     5        ASSIGN_OBJ                                               'password'
          6        OP_DATA                                                  !1
   14     7        ASSIGN_OBJ                                               'admin'
          8        OP_DATA                                                  !2
   15     9      > 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/N3a1U
function name:  __wakeup
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   FETCH_OBJ_R                                      ~1      'name'
          1        FETCH_OBJ_R                                      ~2      'password'
          2        CONCAT                                           ~3      ~1, ~2
          3        ASSIGN_OBJ                                               'fullName'
          4        OP_DATA                                                  ~3
   20     5      > RETURN                                                   null

End of function __wakeup

End of class User.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
181.37 ms | 1400 KiB | 19 Q