3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Test { protected $value = "Default"; public function __destruct() { echo PHP_EOL . serialize($this); echo PHP_EOL . $this->value; } } $testInjected = unserialize("O:4:\"Test\":1:{s:8:\"\0*\0value\";s:8:\"Injected\";}"); $testInjected2 = unserialize("O:4:\"Test\":1:{s:5:\"value\";s:8:\"Injected\";}");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SaDri
function name:  (null)
number of ops:  9
compiled vars:  !0 = $testInjected, !1 = $testInjected2
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   12     0  E >   INIT_FCALL                                                   'unserialize'
          1        SEND_VAL                                                     'O%3A4%3A%22Test%22%3A1%3A%7Bs%3A8%3A%22%00%2A%00value%22%3Bs%3A8%3A%22Injected%22%3B%7D'
          2        DO_ICALL                                             $2      
          3        ASSIGN                                                       !0, $2
   13     4        INIT_FCALL                                                   'unserialize'
          5        SEND_VAL                                                     'O%3A4%3A%22Test%22%3A1%3A%7Bs%3A5%3A%22value%22%3Bs%3A8%3A%22Injected%22%3B%7D'
          6        DO_ICALL                                             $4      
          7        ASSIGN                                                       !1, $4
          8      > RETURN                                                       1

Class Test:
Function __destruct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SaDri
function name:  __destruct
number of ops:  10
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    7     0  E >   INIT_FCALL                                                   'serialize'
          1        FETCH_THIS                                           ~0      
          2        SEND_VAL                                                     ~0
          3        DO_ICALL                                             $1      
          4        CONCAT                                               ~2      '%0A', $1
          5        ECHO                                                         ~2
    8     6        FETCH_OBJ_R                                          ~3      'value'
          7        CONCAT                                               ~4      '%0A', ~3
          8        ECHO                                                         ~4
    9     9      > RETURN                                                       null

End of function __destruct

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
167.61 ms | 3339 KiB | 15 Q