3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A extends SplObjectStorage { protected $b; protected $a = [ 'date' => null, ]; public function __construct(B $b) { $this->b = $b; $this->a = [ 'date' => '123', ]; } public function getA() { return $this->a; } } class B{} $serialized = serialize(new A(new B)); $obj = unserialize($serialized); /*$reader = function & ($object, $property) { $value = & \Closure::bind(function & () use ($property) { return $this->$property; }, $object, $object)->__invoke(); return $value; };*/ //$test3 = & $reader($obj, 'a'); echo "Result from Getter\n"; var_dump($obj->getA()); /*echo "Result from Reflection\n"; var_Dump($test3);*/ echo "This is the deserialized Object\n"; var_Dump($obj); var_Dump($obj['date']);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Mgd4t
function name:  (null)
number of ops:  28
compiled vars:  !0 = $serialized, !1 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   INIT_FCALL                                               'serialize'
          1        NEW                                              $2      'A'
          2        NEW                                              $3      'B'
          3        DO_FCALL                                      0          
          4        SEND_VAR_NO_REF_EX                                       $3
          5        DO_FCALL                                      0          
          6        SEND_VAR                                                 $2
          7        DO_ICALL                                         $6      
          8        ASSIGN                                                   !0, $6
   27     9        INIT_FCALL                                               'unserialize'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                         $8      
         12        ASSIGN                                                   !1, $8
   39    13        ECHO                                                     'Result+from+Getter%0A'
   40    14        INIT_FCALL                                               'var_dump'
         15        INIT_METHOD_CALL                                         !1, 'getA'
         16        DO_FCALL                                      0  $10     
         17        SEND_VAR                                                 $10
         18        DO_ICALL                                                 
   45    19        ECHO                                                     'This+is+the+deserialized+Object%0A'
   46    20        INIT_FCALL                                               'var_dump'
         21        SEND_VAR                                                 !1
         22        DO_ICALL                                                 
   48    23        INIT_FCALL                                               'var_dump'
         24        FETCH_DIM_R                                      ~13     !1, 'date'
         25        SEND_VAL                                                 ~13
         26        DO_ICALL                                                 
         27      > RETURN                                                   1

Class A:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Mgd4t
function name:  __construct
number of ops:  6
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
   12     1        ASSIGN_OBJ                                               'b'
          2        OP_DATA                                                  !0
   13     3        ASSIGN_OBJ                                               'a'
   14     4        OP_DATA                                                  <array>
   16     5      > RETURN                                                   null

End of function __construct

Function geta:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Mgd4t
function name:  getA
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   FETCH_OBJ_R                                      ~0      'a'
          1      > RETURN                                                   ~0
   21     2*     > RETURN                                                   null

End of function geta

End of class A.

Class B: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.93 ms | 1400 KiB | 19 Q