3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { function __wakeup() { print "[-] Wakeup method called!\n"; } function __destruct() { print "[-] Destruct method called!\n"; var_dump($this); } } $normal = 'O:3:"Foo":1:{s:1:"x";s:1:"y";}'; $broken = 'O:3:"Foo":2:{s:1:"x";s:1:"y";}'; unserialize($normal); unserialize($broken);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QqeAD
function name:  (null)
number of ops:  9
compiled vars:  !0 = $normal, !1 = $broken
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   ASSIGN                                                   !0, 'O%3A3%3A%22Foo%22%3A1%3A%7Bs%3A1%3A%22x%22%3Bs%3A1%3A%22y%22%3B%7D'
   18     1        ASSIGN                                                   !1, 'O%3A3%3A%22Foo%22%3A2%3A%7Bs%3A1%3A%22x%22%3Bs%3A1%3A%22y%22%3B%7D'
   20     2        INIT_FCALL                                               'unserialize'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                                 
   21     5        INIT_FCALL                                               'unserialize'
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                                 
          8      > RETURN                                                   1

Class Foo:
Function __wakeup:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QqeAD
function name:  __wakeup
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ECHO                                                     '%5B-%5D+Wakeup+method+called%21%0A'
    8     1      > RETURN                                                   null

End of function __wakeup

Function __destruct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QqeAD
function name:  __destruct
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   ECHO                                                     '%5B-%5D+Destruct+method+called%21%0A'
   13     1        INIT_FCALL                                               'var_dump'
          2        FETCH_THIS                                       ~0      
          3        SEND_VAL                                                 ~0
          4        DO_ICALL                                                 
   14     5      > RETURN                                                   null

End of function __destruct

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.34 ms | 1460 KiB | 15 Q