3v4l.org

run code in 300+ PHP versions simultaneously
<?php class foo implements Serializable { public $dummy = 'bzz'; public function serialize() { throw new Exception('test'); } public function unserialize($data) { } } $serialized = serialize(new foo); $unserialized = unserialize($serialized); var_dump($serialized, $unserialized);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cuImR
function name:  (null)
number of ops:  16
compiled vars:  !0 = $serialized, !1 = $unserialized
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'foo'
   17     1        INIT_FCALL                                               'serialize'
          2        NEW                                              $2      'foo'
          3        DO_FCALL                                      0          
          4        SEND_VAR                                                 $2
          5        DO_ICALL                                         $4      
          6        ASSIGN                                                   !0, $4
   18     7        INIT_FCALL                                               'unserialize'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                         $6      
         10        ASSIGN                                                   !1, $6
   20    11        INIT_FCALL                                               'var_dump'
         12        SEND_VAR                                                 !0
         13        SEND_VAR                                                 !1
         14        DO_ICALL                                                 
         15      > RETURN                                                   1

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

End of function serialize

Function unserialize:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cuImR
function name:  unserialize
number of ops:  2
compiled vars:  !0 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
   14     1      > RETURN                                                   null

End of function unserialize

End of class foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.64 ms | 1396 KiB | 19 Q