3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { function __destruct() { echo "Called Destruct!!\n"; var_dump($this); } } $a='a:2:{s:4:"cccc";O:3:"foo":3:{s:1:"x";s:1:"y";s:123:"name";s:8:"filename";s:13:"/tmp/evil.php";};i:1;s:4:"bbbb";}'; $b= var_dump(unserialize($a));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ni2Sd
function name:  (null)
number of ops:  9
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'a%3A2%3A%7Bs%3A4%3A%22cccc%22%3BO%3A3%3A%22foo%22%3A3%3A%7Bs%3A1%3A%22x%22%3Bs%3A1%3A%22y%22%3Bs%3A123%3A%22name%22%3Bs%3A8%3A%22filename%22%3Bs%3A13%3A%22%2Ftmp%2Fevil.php%22%3B%7D%3Bi%3A1%3Bs%3A4%3A%22bbbb%22%3B%7D'
    4     1        INIT_FCALL                                               'var_dump'
          2        INIT_FCALL                                               'unserialize'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $3      
          5        SEND_VAR                                                 $3
          6        DO_ICALL                                         $4      
          7        ASSIGN                                                   !1, $4
          8      > RETURN                                                   1

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

End of function __destruct

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.56 ms | 1011 KiB | 15 Q