3v4l.org

run code in 300+ PHP versions simultaneously
<?php class RefMef { private $_; public function __construct($ref) { $this->_ = $ref; } } class RoleStorage extends SPLObjectStorage { private $membres; public function serialize() { return parent::serialize(); } public function unserialize($serialized) { var_dump($serialized); parent::unserialize($serialized); } } $obj1 = new RefMef(1); $obj2 = new RefMef($obj1); $test = new RoleStorage; // $test->attach($obj2); // $test->attach($obj1); // $test->attach($test); echo $ser = serialize($test), "\n"; $try = unserialize($ser); // $test = unserialize('C:11:"RoleStorage":23:{x:i:1;N;,r:13;;m:a:0:{}}');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jNLZM
function name:  (null)
number of ops:  22
compiled vars:  !0 = $obj1, !1 = $obj2, !2 = $test, !3 = $ser, !4 = $try
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   NEW                                              $5      'RefMef'
          1        SEND_VAL_EX                                              1
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $5
   25     4        NEW                                              $8      'RefMef'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $8
   27     8        NEW                                              $11     'RoleStorage'
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !2, $11
   32    11        INIT_FCALL                                               'serialize'
         12        SEND_VAR                                                 !2
         13        DO_ICALL                                         $14     
         14        ASSIGN                                           ~15     !3, $14
         15        ECHO                                                     ~15
         16        ECHO                                                     '%0A'
   34    17        INIT_FCALL                                               'unserialize'
         18        SEND_VAR                                                 !3
         19        DO_ICALL                                         $16     
         20        ASSIGN                                                   !4, $16
   36    21      > RETURN                                                   1

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

End of function __construct

End of class RefMef.

Class RoleStorage:
Function serialize:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jNLZM
function name:  serialize
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   INIT_STATIC_METHOD_CALL                                  'serialize'
          1        DO_FCALL                                      0  $0      
          2      > RETURN                                                   $0
   17     3*     > 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/jNLZM
function name:  unserialize
number of ops:  8
compiled vars:  !0 = $serialized
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   RECV                                             !0      
   19     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
   20     4        INIT_STATIC_METHOD_CALL                                  'unserialize'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0          
   21     7      > RETURN                                                   null

End of function unserialize

End of class RoleStorage.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
205.4 ms | 1400 KiB | 19 Q