3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Kitchen { private $yummy = 'cake'; function __destruct() { if ($this->yummy == 'aaaa') echo 'win!'; } } $obj = new Kitchen(); $refObject = new ReflectionObject( $obj ); $refProperty = $refObject->getProperty( 'yummy' ); $refProperty->setAccessible( true ); $refProperty->setValue($refProperty, 'aaaa'); //var_dump($refProperty); //var_dump($refProperty); unserialize(serialize($refProperty));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BCFVV
function name:  (null)
number of ops:  25
compiled vars:  !0 = $obj, !1 = $refObject, !2 = $refProperty
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   NEW                                              $3      'Kitchen'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
   10     3        NEW                                              $6      'ReflectionObject'
          4        SEND_VAR_EX                                              !0
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !1, $6
   11     7        INIT_METHOD_CALL                                         !1, 'getProperty'
          8        SEND_VAL_EX                                              'yummy'
          9        DO_FCALL                                      0  $9      
         10        ASSIGN                                                   !2, $9
   12    11        INIT_METHOD_CALL                                         !2, 'setAccessible'
         12        SEND_VAL_EX                                              <true>
         13        DO_FCALL                                      0          
   13    14        INIT_METHOD_CALL                                         !2, 'setValue'
         15        SEND_VAR_EX                                              !2
         16        SEND_VAL_EX                                              'aaaa'
         17        DO_FCALL                                      0          
   17    18        INIT_FCALL                                               'unserialize'
         19        INIT_FCALL                                               'serialize'
         20        SEND_VAR                                                 !2
         21        DO_ICALL                                         $13     
         22        SEND_VAR                                                 $13
         23        DO_ICALL                                                 
         24      > RETURN                                                   1

Class Kitchen:
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/BCFVV
function name:  __destruct
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   FETCH_OBJ_R                                      ~0      'yummy'
          1        IS_EQUAL                                                 ~0, 'aaaa'
          2      > JMPZ                                                     ~1, ->4
          3    >   ECHO                                                     'win%21'
          4    > > RETURN                                                   null

End of function __destruct

End of class Kitchen.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.31 ms | 1396 KiB | 17 Q