3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { protected $bar = 'protected_value'; private $baz = 'private_prop'; } $F = new Foo(); $F = serialize($F); var_dump($F); $F = str_replace('private_value','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); var_dump($F);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/d9i35
function name:  (null)
number of ops:  33
compiled vars:  !0 = $F
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   NEW                                              $1      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
    9     3        INIT_FCALL                                               'serialize'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $4      
          6        ASSIGN                                                   !0, $4
   10     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                                 
   11    10        INIT_FCALL                                               'str_replace'
         11        SEND_VAL                                                 'private_value'
         12        SEND_VAL                                                 'new_private_prop'
         13        SEND_VAR                                                 !0
         14        DO_ICALL                                         $7      
         15        ASSIGN                                                   !0, $7
   12    16        INIT_FCALL                                               'preg_replace_callback'
         17        SEND_VAL                                                 '%21s%3A%28%5Cd%2B%29%3A%22%28.%2A%3F%29%22%3B%21'
         18        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fd9i35%3A12%240'
   14    19        SEND_VAL                                                 ~9
         20        SEND_VAR                                                 !0
         21        DO_ICALL                                         $10     
   12    22        ASSIGN                                                   !0, $10
   15    23        BEGIN_SILENCE                                    ~12     
         24        INIT_FCALL                                               'unserialize'
         25        SEND_VAR                                                 !0
         26        DO_ICALL                                         $13     
         27        END_SILENCE                                              ~12
         28        ASSIGN                                                   !0, $13
   16    29        INIT_FCALL                                               'var_dump'
         30        SEND_VAR                                                 !0
         31        DO_ICALL                                                 
         32      > RETURN                                                   1

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

End of function %00%7Bclosure%7D%2Fin%2Fd9i35%3A12%240

Class Foo: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.75 ms | 1400 KiB | 23 Q