3v4l.org

run code in 300+ PHP versions simultaneously
<?php $s1 = 'O:8:"DateTime":3:{s:4:"date";s:20:"10007-06-07 03:51:49";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}'; $s2 = 'O:3:"Foo":3:{s:4:"date";s:20:"10007-06-07 03:51:49";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}'; global $foo; class Foo extends DateTime { function __wakeupss() { global $foo; $foo = $this; parent::__wakeup(); } public static function __set_state($a) { global $foo; $foo = $this; return; } } // Old test case try { unserialize( $s1 ); } catch ( Exception $e ) {} // My test case try { unserialize( $s2 ); } catch ( Exception $e ) {} var_dump( $foo );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 7
Branch analysis from position: 7
2 jumps found. (Code = 107) Position 1 = 8, Position 2 = -2
Branch analysis from position: 8
Found catch point at position: 12
Branch analysis from position: 12
2 jumps found. (Code = 107) Position 1 = 13, Position 2 = -2
Branch analysis from position: 13
filename:       /in/ln2Pj
function name:  (null)
number of ops:  17
compiled vars:  !0 = $s1, !1 = $s2, !2 = $foo, !3 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'O%3A8%3A%22DateTime%22%3A3%3A%7Bs%3A4%3A%22date%22%3Bs%3A20%3A%2210007-06-07+03%3A51%3A49%22%3Bs%3A13%3A%22timezone_type%22%3Bi%3A3%3Bs%3A8%3A%22timezone%22%3Bs%3A3%3A%22UTC%22%3B%7D'
    4     1        ASSIGN                                                   !1, 'O%3A3%3A%22Foo%22%3A3%3A%7Bs%3A4%3A%22date%22%3Bs%3A20%3A%2210007-06-07+03%3A51%3A49%22%3Bs%3A13%3A%22timezone_type%22%3Bi%3A3%3Bs%3A8%3A%22timezone%22%3Bs%3A3%3A%22UTC%22%3B%7D'
    6     2        BIND_GLOBAL                                              !2, 'foo'
   24     3        INIT_FCALL                                               'unserialize'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                                 
          6      > JMP                                                      ->8
   25     7  E > > CATCH                                       last         'Exception'
   29     8    >   INIT_FCALL                                               'unserialize'
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                                 
         11      > JMP                                                      ->13
   30    12  E > > CATCH                                       last         'Exception'
   31    13    >   INIT_FCALL                                               'var_dump'
         14        SEND_VAR                                                 !2
         15        DO_ICALL                                                 
         16      > RETURN                                                   1

Class Foo:
Function __wakeupss:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ln2Pj
function name:  __wakeupss
number of ops:  6
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   BIND_GLOBAL                                              !0, 'foo'
   11     1        FETCH_THIS                                       ~1      
          2        ASSIGN                                                   !0, ~1
   12     3        INIT_STATIC_METHOD_CALL                                  '__wakeup'
          4        DO_FCALL                                      0          
   13     5      > RETURN                                                   null

End of function __wakeupss

Function __set_state:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ln2Pj
function name:  __set_state
number of ops:  6
compiled vars:  !0 = $a, !1 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
   16     1        BIND_GLOBAL                                              !1, 'foo'
   17     2        FETCH_THIS                                       ~2      
          3        ASSIGN                                                   !1, ~2
   18     4      > RETURN                                                   null
   19     5*     > RETURN                                                   null

End of function __set_state

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.12 ms | 1400 KiB | 17 Q