3v4l.org

run code in 500+ PHP versions simultaneously
<?php declare(strict_types = 1); class C { function __serialize() { return ['a' => 'b']; } /** @param array<string, string> $a */ function __unserialize(array $a) { throw new Exception("nope"); } } $c = new C(); $s = serialize($c); try { unserialize($s); } catch (Exception $e) { echo "caught " . $e->getMessage(); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 11
Branch analysis from position: 11
2 jumps found. (Code = 107) Position 1 = 12, Position 2 = -2
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fFikH
function name:  (null)
number of ops:  17
compiled vars:  !0 = $c, !1 = $s, !2 = $e
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   14     0  E >   NEW                                                  $3      'C'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $3
   15     3        INIT_FCALL                                                   'serialize'
          4        SEND_VAR                                                     !0
          5        DO_ICALL                                             $6      
          6        ASSIGN                                                       !1, $6
   18     7        INIT_FCALL                                                   'unserialize'
          8        SEND_VAR                                                     !1
          9        DO_ICALL                                                     
         10      > JMP                                                          ->16
   19    11  E > > CATCH                                           last         'Exception'
   20    12    >   INIT_METHOD_CALL                                             !2, 'getMessage'
         13        DO_FCALL                                          0  $9      
         14        CONCAT                                               ~10     'caught+', $9
         15        ECHO                                                         ~10
   21    16    > > RETURN                                                       1

Class C:
Function __serialize:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fFikH
function name:  __serialize
number of ops:  2
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    6     0  E > > RETURN                                                       <array>
    7     1*     > RETURN                                                       null

End of function __serialize

Function __unserialize:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/fFikH
function name:  __unserialize
number of ops:  6
compiled vars:  !0 = $a
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    9     0  E >   RECV                                                 !0      
   10     1        NEW                                                  $1      'Exception'
          2        SEND_VAL_EX                                                  'nope'
          3        DO_FCALL                                          0          
          4      > THROW                                             0          $1
   11     5*     > RETURN                                                       null

End of function __unserialize

End of class C.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
127.48 ms | 479 KiB | 9 Q