3v4l.org

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

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

End of function %00%7Bclosure%7D%2Fin%2FnOjie%3A18%240

Class Foo:
Function out:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nOjie
function name:  out
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   FETCH_OBJ_R                                      ~0      'a'
          1        CONCAT                                           ~1      ~0, '+'
          2        FETCH_OBJ_R                                      ~2      'b'
          3        CONCAT                                           ~3      ~1, ~2
          4        CONCAT                                           ~4      ~3, '%3Cbr%2F%3E'
          5        ECHO                                                     ~4
   10     6      > RETURN                                                   null

End of function out

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.08 ms | 1392 KiB | 21 Q