3v4l.org

run code in 300+ PHP versions simultaneously
<?php class T { private $allowed22 = 1; private $allowed = 0; function __destruct() { if ($this->allowed == 1) echo file_get_contents("key.php"); } } $g = new T(); $res = serialize($g); echo $res;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VHOvf
function name:  (null)
number of ops:  9
compiled vars:  !0 = $g, !1 = $res
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   NEW                                              $2      'T'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   10     3        INIT_FCALL                                               'serialize'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $5      
          6        ASSIGN                                                   !1, $5
   12     7        ECHO                                                     !1
          8      > RETURN                                                   1

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

End of function __destruct

End of class T.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.2 ms | 1386 KiB | 17 Q