3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A implements Serializable { public function unserialize($p) { echo 'uns'; } public function serialize() { return ''; } } class B { public function __wakeup() { echo 'wak';throw new Exception; } public function __destruct() { echo 'des'; } } $g[]=new B; $g[]=new A; echo serialize($g); $s='a:2:{i:0;O:1:"B":0:{}i:1;C:1:"A":0:{}}'; var_dump(unserialize($s));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/77DE1
function name:  (null)
number of ops:  21
compiled vars:  !0 = $g, !1 = $s
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   DECLARE_CLASS                                            'a'
   18     1        NEW                                              $3      'B'
          2        DO_FCALL                                      0          
          3        ASSIGN_DIM                                               !0
          4        OP_DATA                                                  $3
   19     5        NEW                                              $6      'A'
          6        DO_FCALL                                      0          
          7        ASSIGN_DIM                                               !0
          8        OP_DATA                                                  $6
   20     9        INIT_FCALL                                               'serialize'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                         $8      
         12        ECHO                                                     $8
   21    13        ASSIGN                                                   !1, 'a%3A2%3A%7Bi%3A0%3BO%3A1%3A%22B%22%3A0%3A%7B%7Di%3A1%3BC%3A1%3A%22A%22%3A0%3A%7B%7D%7D'
   22    14        INIT_FCALL                                               'var_dump'
         15        INIT_FCALL                                               'unserialize'
         16        SEND_VAR                                                 !1
         17        DO_ICALL                                         $10     
         18        SEND_VAR                                                 $10
         19        DO_ICALL                                                 
         20      > RETURN                                                   1

Class A:
Function unserialize:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/77DE1
function name:  unserialize
number of ops:  3
compiled vars:  !0 = $p
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        ECHO                                                     'uns'
    5     2      > RETURN                                                   null

End of function unserialize

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

End of function serialize

End of class A.

Class B:
Function __wakeup:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/77DE1
function name:  __wakeup
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   ECHO                                                     'wak'
          1        NEW                                              $0      'Exception'
          2        DO_FCALL                                      0          
          3      > THROW                                         0          $0
   13     4*     > RETURN                                                   null

End of function __wakeup

Function __destruct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/77DE1
function name:  __destruct
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   ECHO                                                     'des'
   16     1      > RETURN                                                   null

End of function __destruct

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.58 ms | 1400 KiB | 19 Q