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); var_dump($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 F){ $F->out(); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 45, Position 2 = 47
Branch analysis from position: 45
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 47
filename:       /in/fXY2W
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                                               'var_dump'
         18        SEND_VAR                                                 !0
         19        DO_ICALL                                                 
   23    20        INIT_FCALL                                               'str_replace'
         21        SEND_VAL                                                 'protected_prop'
         22        SEND_VAL                                                 'new_protected_prop'
         23        SEND_VAR                                                 !0
         24        DO_ICALL                                         $14     
         25        ASSIGN                                                   !0, $14
   24    26        INIT_FCALL                                               'str_replace'
         27        SEND_VAL                                                 'private_prop'
         28        SEND_VAL                                                 'new_private_prop'
         29        SEND_VAR                                                 !0
         30        DO_ICALL                                         $16     
         31        ASSIGN                                                   !0, $16
   25    32        INIT_FCALL                                               'preg_replace_callback'
         33        SEND_VAL                                                 '%21s%3A%28%5Cd%2B%29%3A%22%28.%2A%3F%29%22%3B%21'
         34        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FfXY2W%3A25%240'
   27    35        SEND_VAL                                                 ~18
         36        SEND_VAR                                                 !0
         37        DO_ICALL                                         $19     
   25    38        ASSIGN                                                   !0, $19
   28    39        INIT_FCALL                                               'unserialize'
         40        SEND_VAR                                                 !0
         41        DO_ICALL                                         $21     
         42        ASSIGN                                                   !0, $21
   29    43        INSTANCEOF                                               !0, 'F'
         44      > JMPZ                                                     ~23, ->47
   30    45    >   INIT_METHOD_CALL                                         !0, 'out'
         46        DO_FCALL                                      0          
   31    47    > > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FfXY2W%3A25%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/fXY2W
function name:  {closure}
number of ops:  19
compiled vars:  !0 = $match
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   RECV                                             !0      
   26     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
   27    18*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FfXY2W%3A25%240

Class Foo:
Function out:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fXY2W
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:
169.89 ms | 1400 KiB | 23 Q