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 __wakeup() { global $foo; $foo = $this; parent::__wakeup(); } } $f = new Foo(); var_dump($f); return; // Old test case try { unserialize( $s1 ); } catch ( Exception $e ) {} // My test case try { unserialize( $s2 ); } catch ( Exception $e ) { var_dump($e); } //var_dump( $foo );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 14
Branch analysis from position: 14
2 jumps found. (Code = 107) Position 1 = 15, Position 2 = -2
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 19
Branch analysis from position: 19
2 jumps found. (Code = 107) Position 1 = 20, Position 2 = -2
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qpaYP
function name:  (null)
number of ops:  24
compiled vars:  !0 = $s1, !1 = $s2, !2 = $foo, !3 = $f, !4 = $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'
   17     3        NEW                                              $7      'Foo'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !3, $7
   18     6        INIT_FCALL                                               'var_dump'
          7        SEND_VAR                                                 !3
          8        DO_ICALL                                                 
   20     9      > RETURN                                                   null
   24    10*       INIT_FCALL                                               'unserialize'
         11*       SEND_VAR                                                 !0
         12*       DO_ICALL                                                 
         13*       JMP                                                      ->15
   25    14  E > > CATCH                                       last         'Exception'
   29    15    >   INIT_FCALL                                               'unserialize'
         16        SEND_VAR                                                 !1
         17        DO_ICALL                                                 
         18      > JMP                                                      ->23
   30    19  E > > CATCH                                       last         'Exception'
   31    20    >   INIT_FCALL                                               'var_dump'
         21        SEND_VAR                                                 !4
         22        DO_ICALL                                                 
   33    23    > > RETURN                                                   1

Class Foo:
Function __wakeup:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qpaYP
function name:  __wakeup
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 __wakeup

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.52 ms | 1400 KiB | 17 Q