3v4l.org

run code in 300+ PHP versions simultaneously
<?php global $foo; class Foo extends DateTime { function __wakeup() { global $foo; $foo = $this; parent::__wakeup(); } } $s2 = 'O:3:"Foo":3:{s:4:"date";s:20:"20007-06-07 03:51:49";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}'; try { unserialize( $s2 ); } catch ( Exception $e ) {} var_dump( $foo );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 6
Branch analysis from position: 6
2 jumps found. (Code = 107) Position 1 = 7, Position 2 = -2
Branch analysis from position: 7
filename:       /in/ND93C
function name:  (null)
number of ops:  11
compiled vars:  !0 = $foo, !1 = $s2, !2 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   BIND_GLOBAL                                              !0, 'foo'
   14     1        ASSIGN                                                   !1, 'O%3A3%3A%22Foo%22%3A3%3A%7Bs%3A4%3A%22date%22%3Bs%3A20%3A%2220007-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'
   17     2        INIT_FCALL                                               'unserialize'
          3        SEND_VAR                                                 !1
          4        DO_ICALL                                                 
          5      > JMP                                                      ->7
   18     6  E > > CATCH                                       last         'Exception'
   19     7    >   INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

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

End of function __wakeup

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.3 ms | 1395 KiB | 17 Q