3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public string $a; public string $b = '123'; public function __sleep() { return ['b']; } } $a = unserialize(serialize(new A())); echo $a->a;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ksvnC
function name:  (null)
number of ops:  12
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   INIT_FCALL                                               'unserialize'
          1        INIT_FCALL                                               'serialize'
          2        NEW                                              $1      'A'
          3        DO_FCALL                                      0          
          4        SEND_VAR                                                 $1
          5        DO_ICALL                                         $3      
          6        SEND_VAR                                                 $3
          7        DO_ICALL                                         $4      
          8        ASSIGN                                                   !0, $4
   16     9        FETCH_OBJ_R                                      ~6      !0, 'a'
         10        ECHO                                                     ~6
   17    11      > RETURN                                                   1

Class A:
Function __sleep:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ksvnC
function name:  __sleep
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E > > RETURN                                                   <array>
   11     1*     > RETURN                                                   null

End of function __sleep

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.32 ms | 1399 KiB | 17 Q