3v4l.org

run code in 300+ PHP versions simultaneously
<?php class HasProp { public int $x; public function __sleep() { return ['x']; } } $x = new HasProp(); // string(28) "O:7:"HasProp":1:{s:1:"x";N;}" var_dump($s = serialize($x)); // Fatal error: Uncaught TypeError: Typed property HasProp::$x must be int, null used in ... unserialize($s);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PCLm3
function name:  (null)
number of ops:  14
compiled vars:  !0 = $x, !1 = $s
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   NEW                                              $2      'HasProp'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
    8     3        INIT_FCALL                                               'var_dump'
          4        INIT_FCALL                                               'serialize'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $5      
          7        ASSIGN                                           ~6      !1, $5
          8        SEND_VAL                                                 ~6
          9        DO_ICALL                                                 
   10    10        INIT_FCALL                                               'unserialize'
         11        SEND_VAR                                                 !1
         12        DO_ICALL                                                 
         13      > RETURN                                                   1

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

End of function __sleep

End of class HasProp.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.2 ms | 1395 KiB | 19 Q