3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A{ public $a; public function __construct($a) { $this->a = $a; } public function __wakeup() { printf("Calling wakeup, a=%d\n", $this->a); if ($this->a === 3) { throw new Exception("wakeup threw exception"); } } } $x = [new A(1), new A(2), new A(3), new A(4), new A(5)]; unserialize(serialize($x));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/iXPi6
function name:  (null)
number of ops:  28
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   NEW                                              $1      'A'
          1        SEND_VAL_EX                                              1
          2        DO_FCALL                                      0          
          3        INIT_ARRAY                                       ~3      $1
          4        NEW                                              $4      'A'
          5        SEND_VAL_EX                                              2
          6        DO_FCALL                                      0          
          7        ADD_ARRAY_ELEMENT                                ~3      $4
          8        NEW                                              $6      'A'
          9        SEND_VAL_EX                                              3
         10        DO_FCALL                                      0          
         11        ADD_ARRAY_ELEMENT                                ~3      $6
         12        NEW                                              $8      'A'
         13        SEND_VAL_EX                                              4
         14        DO_FCALL                                      0          
         15        ADD_ARRAY_ELEMENT                                ~3      $8
         16        NEW                                              $10     'A'
         17        SEND_VAL_EX                                              5
         18        DO_FCALL                                      0          
         19        ADD_ARRAY_ELEMENT                                ~3      $10
         20        ASSIGN                                                   !0, ~3
   15    21        INIT_FCALL                                               'unserialize'
         22        INIT_FCALL                                               'serialize'
         23        SEND_VAR                                                 !0
         24        DO_ICALL                                         $13     
         25        SEND_VAR                                                 $13
         26        DO_ICALL                                                 
         27      > RETURN                                                   1

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

End of function __construct

Function __wakeup:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 12
Branch analysis from position: 8
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/iXPi6
function name:  __wakeup
number of ops:  13
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_FCALL                                               'printf'
          1        SEND_VAL                                                 'Calling+wakeup%2C+a%3D%25d%0A'
          2        FETCH_OBJ_R                                      ~0      'a'
          3        SEND_VAL                                                 ~0
          4        DO_ICALL                                                 
    8     5        FETCH_OBJ_R                                      ~2      'a'
          6        IS_IDENTICAL                                             ~2, 3
          7      > JMPZ                                                     ~3, ->12
    9     8    >   NEW                                              $4      'Exception'
          9        SEND_VAL_EX                                              'wakeup+threw+exception'
         10        DO_FCALL                                      0          
         11      > THROW                                         0          $4
   11    12    > > RETURN                                                   null

End of function __wakeup

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.08 ms | 1005 KiB | 16 Q