3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { protected $a = 'protected_prop'; private $b = 'private_prop'; function out(){ var_dump($this->a); var_dump($this->b); } } // reading $F = new Foo(); $data = (array)$F; var_dump($data["\0*\0a"]); var_dump($data["\0Foo\0b"]); // writing $F = serialize($F); $F = str_replace('protected_prop','new_protected_prop',$F); $F = str_replace('private_prop','new_private_prop',$F); $F = preg_replace_callback ( '!s:(\d+):"(.*?)";!', function($match) { return ($match[1] == strlen($match[2])) ? $match[0] : 's:' . strlen($match[2]) . ':"' . $match[2] . '";'; },$F ); $F = unserialize($F); if ($F instanceof Foo){ $F->out(); var_dump($F); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 42, Position 2 = 47
Branch analysis from position: 42
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 47
filename:       /in/nKLFs
function name:  (null)
number of ops:  48
compiled vars:  !0 = $F, !1 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   NEW                                              $2      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   16     3        CAST                                          7  ~5      !0
          4        ASSIGN                                                   !1, ~5
   17     5        INIT_FCALL                                               'var_dump'
          6        FETCH_DIM_R                                      ~7      !1, '%00%2A%00a'
          7        SEND_VAL                                                 ~7
          8        DO_ICALL                                                 
   18     9        INIT_FCALL                                               'var_dump'
         10        FETCH_DIM_R                                      ~9      !1, '%00Foo%00b'
         11        SEND_VAL                                                 ~9
         12        DO_ICALL                                                 
   21    13        INIT_FCALL                                               'serialize'
         14        SEND_VAR                                                 !0
         15        DO_ICALL                                         $11     
         16        ASSIGN                                                   !0, $11
   22    17        INIT_FCALL                                               'str_replace'
         18        SEND_VAL                                                 'protected_prop'
         19        SEND_VAL                                                 'new_protected_prop'
         20        SEND_VAR                                                 !0
         21        DO_ICALL                                         $13     
         22        ASSIGN                                                   !0, $13
   23    23        INIT_FCALL                                               'str_replace'
         24        SEND_VAL                                                 'private_prop'
         25        SEND_VAL                                                 'new_private_prop'
         26        SEND_VAR                                                 !0
         27        DO_ICALL                                         $15     
         28        ASSIGN                                                   !0, $15
   24    29        INIT_FCALL                                               'preg_replace_callback'
         30        SEND_VAL                                                 '%21s%3A%28%5Cd%2B%29%3A%22%28.%2A%3F%29%22%3B%21'
         31        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FnKLFs%3A24%240'
   26    32        SEND_VAL                                                 ~17
         33        SEND_VAR                                                 !0
         34        DO_ICALL                                         $18     
   24    35        ASSIGN                                                   !0, $18
   27    36        INIT_FCALL                                               'unserialize'
         37        SEND_VAR                                                 !0
         38        DO_ICALL                                         $20     
         39        ASSIGN                                                   !0, $20
   28    40        INSTANCEOF                                               !0, 'Foo'
         41      > JMPZ                                                     ~22, ->47
   29    42    >   INIT_METHOD_CALL                                         !0, 'out'
         43        DO_FCALL                                      0          
   30    44        INIT_FCALL                                               'var_dump'
         45        SEND_VAR                                                 !0
         46        DO_ICALL                                                 
   31    47    > > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FnKLFs%3A24%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 9
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nKLFs
function name:  {closure}
number of ops:  19
compiled vars:  !0 = $match
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   RECV                                             !0      
   25     1        FETCH_DIM_R                                      ~1      !0, 1
          2        FETCH_DIM_R                                      ~2      !0, 2
          3        STRLEN                                           ~3      ~2
          4        IS_EQUAL                                                 ~1, ~3
          5      > JMPZ                                                     ~4, ->9
          6    >   FETCH_DIM_R                                      ~5      !0, 0
          7        QM_ASSIGN                                        ~6      ~5
          8      > JMP                                                      ->17
          9    >   FETCH_DIM_R                                      ~7      !0, 2
         10        STRLEN                                           ~8      ~7
         11        CONCAT                                           ~9      's%3A', ~8
         12        CONCAT                                           ~10     ~9, '%3A%22'
         13        FETCH_DIM_R                                      ~11     !0, 2
         14        CONCAT                                           ~12     ~10, ~11
         15        CONCAT                                           ~13     ~12, '%22%3B'
         16        QM_ASSIGN                                        ~6      ~13
         17    > > RETURN                                                   ~6
   26    18*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FnKLFs%3A24%240

Class Foo:
Function out:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nKLFs
function name:  out
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   INIT_FCALL                                               'var_dump'
          1        FETCH_OBJ_R                                      ~0      'a'
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                                 
    9     4        INIT_FCALL                                               'var_dump'
          5        FETCH_OBJ_R                                      ~2      'b'
          6        SEND_VAL                                                 ~2
          7        DO_ICALL                                                 
   11     8      > RETURN                                                   null

End of function out

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.33 ms | 1392 KiB | 23 Q