3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Point implements Serializable { public $y; public function __construct($y) { $this->y = $y; } public function serialize() { return serialize($this->y); } public function unserialize($data) { var_dump(unserialize($data)); } } $d = new DateTime('2025/1/1 00:00:00'); $point = new Point($d); $ser = serialize($point); var_dump($d, $ser); unserialize($ser);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OKcNu
function name:  (null)
number of ops:  21
compiled vars:  !0 = $d, !1 = $point, !2 = $ser
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                                'point'
   16     1        NEW                                                  $3      'DateTime'
          2        SEND_VAL_EX                                                  '2025%2F1%2F1+00%3A00%3A00'
          3        DO_FCALL                                          0          
          4        ASSIGN                                                       !0, $3
   17     5        NEW                                                  $6      'Point'
          6        SEND_VAR_EX                                                  !0
          7        DO_FCALL                                          0          
          8        ASSIGN                                                       !1, $6
   18     9        INIT_FCALL                                                   'serialize'
         10        SEND_VAR                                                     !1
         11        DO_ICALL                                             $9      
         12        ASSIGN                                                       !2, $9
   19    13        INIT_FCALL                                                   'var_dump'
         14        SEND_VAR                                                     !0
         15        SEND_VAR                                                     !2
         16        DO_ICALL                                                     
   20    17        INIT_FCALL                                                   'unserialize'
         18        SEND_VAR                                                     !2
         19        DO_ICALL                                                     
         20      > RETURN                                                       1

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

End of function __construct

Function serialize:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OKcNu
function name:  serialize
number of ops:  6
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    9     0  E >   INIT_FCALL                                                   'serialize'
          1        FETCH_OBJ_R                                          ~0      'y'
          2        SEND_VAL                                                     ~0
          3        DO_ICALL                                             $1      
          4      > RETURN                                                       $1
   10     5*     > RETURN                                                       null

End of function serialize

Function unserialize:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OKcNu
function name:  unserialize
number of ops:  8
compiled vars:  !0 = $data
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   12     0  E >   RECV                                                 !0      
   13     1        INIT_FCALL                                                   'var_dump'
          2        INIT_FCALL                                                   'unserialize'
          3        SEND_VAR                                                     !0
          4        DO_ICALL                                             $1      
          5        SEND_VAR                                                     $1
          6        DO_ICALL                                                     
   14     7      > RETURN                                                       null

End of function unserialize

End of class Point.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
142.53 ms | 497 KiB | 12 Q