3v4l.org

run code in 500+ PHP versions simultaneously
<?php class ReadonlyUnserialize { public function __construct(public readonly string $value) {} public function __unserialize(array $names): void { $this->value = 'set on unserialize'; } } $obj = new ReadonlyUnserialize('test'); $serialized = serialize($obj); $unserialized = unserialize($serialized); print $unserialized->value;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/G0WCa
function name:  (null)
number of ops:  15
compiled vars:  !0 = $obj, !1 = $serialized, !2 = $unserialized
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   11     0  E >   NEW                                                  $3      'ReadonlyUnserialize'
          1        SEND_VAL_EX                                                  'test'
          2        DO_FCALL                                          0          
          3        ASSIGN                                                       !0, $3
   12     4        INIT_FCALL                                                   'serialize'
          5        SEND_VAR                                                     !0
          6        DO_ICALL                                             $6      
          7        ASSIGN                                                       !1, $6
   13     8        INIT_FCALL                                                   'unserialize'
          9        SEND_VAR                                                     !1
         10        DO_ICALL                                             $8      
         11        ASSIGN                                                       !2, $8
   14    12        FETCH_OBJ_R                                          ~10     !2, 'value'
         13        ECHO                                                         ~10
   15    14      > RETURN                                                       1

Class ReadonlyUnserialize:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/G0WCa
function name:  __construct
number of ops:  4
compiled vars:  !0 = $value
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E >   RECV                                                 !0      
          1        ASSIGN_OBJ                                                   'value'
          2        OP_DATA                                                      !0
          3      > RETURN                                                       null

End of function __construct

Function __unserialize:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/G0WCa
function name:  __unserialize
number of ops:  4
compiled vars:  !0 = $names
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    6     0  E >   RECV                                                 !0      
    7     1        ASSIGN_OBJ                                                   'value'
          2        OP_DATA                                                      'set+on+unserialize'
    8     3      > RETURN                                                       null

End of function __unserialize

End of class ReadonlyUnserialize.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
161.76 ms | 1313 KiB | 15 Q