3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private $foo; } class Bar extends Foo { private $foo; } class Baz extends Bar { private $foo; } $obj = new Baz; $data = serialize((array) $obj); $data = str_replace('a:3:{', 'O:3:"Baz":3:{', $data); var_dump(unserialize($data));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3QarT
function name:  (null)
number of ops:  21
compiled vars:  !0 = $obj, !1 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   NEW                                              $2      'Baz'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   15     3        INIT_FCALL                                               'serialize'
          4        CAST                                          7  ~5      !0
          5        SEND_VAL                                                 ~5
          6        DO_ICALL                                         $6      
          7        ASSIGN                                                   !1, $6
   16     8        INIT_FCALL                                               'str_replace'
          9        SEND_VAL                                                 'a%3A3%3A%7B'
         10        SEND_VAL                                                 'O%3A3%3A%22Baz%22%3A3%3A%7B'
         11        SEND_VAR                                                 !1
         12        DO_ICALL                                         $8      
         13        ASSIGN                                                   !1, $8
   17    14        INIT_FCALL                                               'var_dump'
         15        INIT_FCALL                                               'unserialize'
         16        SEND_VAR                                                 !1
         17        DO_ICALL                                         $10     
         18        SEND_VAR                                                 $10
         19        DO_ICALL                                                 
         20      > RETURN                                                   1

Class Foo: [no user functions]
Class Bar: [no user functions]
Class Baz: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.31 ms | 1395 KiB | 21 Q