3v4l.org

run code in 300+ PHP versions simultaneously
<?php class T { private $allowed = 0; function __destruct() { if ($this->allowed == 1) echo "SUCCESS"; } }; $a = new T(); print(base64_encode(serialize($a))); print('\n'); $data ="O:1:\"T\":1:{s:10:\"Tallowed\";i:0;}"; print($data); print('\n'); var_dump(unserialize($data)); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3eK04
function name:  (null)
number of ops:  21
compiled vars:  !0 = $a, !1 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   NEW                                              $2      'T'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
    9     3        INIT_FCALL                                               'base64_encode'
          4        INIT_FCALL                                               'serialize'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $5      
          7        SEND_VAR                                                 $5
          8        DO_ICALL                                         $6      
          9        ECHO                                                     $6
   10    10        ECHO                                                     '%5Cn'
   11    11        ASSIGN                                                   !1, 'O%3A1%3A%22T%22%3A1%3A%7Bs%3A10%3A%22Tallowed%22%3Bi%3A0%3B%7D'
   12    12        ECHO                                                     !1
   13    13        ECHO                                                     '%5Cn'
   14    14        INIT_FCALL                                               'var_dump'
         15        INIT_FCALL                                               'unserialize'
         16        SEND_VAR                                                 !1
         17        DO_ICALL                                         $8      
         18        SEND_VAR                                                 $8
         19        DO_ICALL                                                 
   16    20      > RETURN                                                   1

Class T:
Function __destruct:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 4
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
filename:       /in/3eK04
function name:  __destruct
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   FETCH_OBJ_R                                      ~0      'allowed'
          1        IS_EQUAL                                                 ~0, 1
          2      > JMPZ                                                     ~1, ->4
          3    >   ECHO                                                     'SUCCESS'
          4    > > RETURN                                                   null

End of function __destruct

End of class T.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.85 ms | 1396 KiB | 21 Q