3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ZeroDayTechnique { public function key($action = 'get', $value = null) { static $hidden = []; switch ($action) { case 'get': return $hidden[spl_object_hash($this)]; case 'set': $hidden[spl_object_hash($this)] = $value; break; default: throw new Exception('Wut in da hell'); } } } $x = new ZeroDayTechnique; $not_x = new ZeroDayTechnique; $x->key('set', random_bytes(32)); var_dump(bin2hex($x->key('get'))); $not_x->key('set', random_bytes(32)); var_dump(bin2hex($x->key('get'))); var_dump(bin2hex($not_x->key('get'))); var_dump($x);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NsBcp
function name:  (null)
number of ops:  51
compiled vars:  !0 = $x, !1 = $not_x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   NEW                                              $2      'ZeroDayTechnique'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   19     3        NEW                                              $5      'ZeroDayTechnique'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $5
   21     6        INIT_METHOD_CALL                                         !0, 'key'
          7        SEND_VAL_EX                                              'set'
          8        INIT_FCALL                                               'random_bytes'
          9        SEND_VAL                                                 32
         10        DO_ICALL                                         $8      
         11        SEND_VAR_NO_REF_EX                                       $8
         12        DO_FCALL                                      0          
   23    13        INIT_FCALL                                               'var_dump'
         14        INIT_FCALL                                               'bin2hex'
         15        INIT_METHOD_CALL                                         !0, 'key'
         16        SEND_VAL_EX                                              'get'
         17        DO_FCALL                                      0  $10     
         18        SEND_VAR                                                 $10
         19        DO_ICALL                                         $11     
         20        SEND_VAR                                                 $11
         21        DO_ICALL                                                 
   25    22        INIT_METHOD_CALL                                         !1, 'key'
         23        SEND_VAL_EX                                              'set'
         24        INIT_FCALL                                               'random_bytes'
         25        SEND_VAL                                                 32
         26        DO_ICALL                                         $13     
         27        SEND_VAR_NO_REF_EX                                       $13
         28        DO_FCALL                                      0          
   28    29        INIT_FCALL                                               'var_dump'
         30        INIT_FCALL                                               'bin2hex'
         31        INIT_METHOD_CALL                                         !0, 'key'
         32        SEND_VAL_EX                                              'get'
         33        DO_FCALL                                      0  $15     
         34        SEND_VAR                                                 $15
         35        DO_ICALL                                         $16     
         36        SEND_VAR                                                 $16
         37        DO_ICALL                                                 
   29    38        INIT_FCALL                                               'var_dump'
         39        INIT_FCALL                                               'bin2hex'
         40        INIT_METHOD_CALL                                         !1, 'key'
         41        SEND_VAL_EX                                              'get'
         42        DO_FCALL                                      0  $18     
         43        SEND_VAR                                                 $18
         44        DO_ICALL                                         $19     
         45        SEND_VAR                                                 $19
         46        DO_ICALL                                                 
   31    47        INIT_FCALL                                               'var_dump'
         48        SEND_VAR                                                 !0
         49        DO_ICALL                                                 
         50      > RETURN                                                   1

Class ZeroDayTechnique:
Function key:
Finding entry points
Branch analysis from position: 0
4 jumps found. (Code = 188) Position 1 = 9, Position 2 = 15, Position 3 = 22, Position 4 = 4
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 4
2 jumps found. (Code = 44) Position 1 = 6, Position 2 = 9
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 8, Position 2 = 15
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
Branch analysis from position: 15
Branch analysis from position: 9
filename:       /in/NsBcp
function name:  key
number of ops:  27
compiled vars:  !0 = $action, !1 = $value, !2 = $hidden
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV_INIT                                        !0      'get'
          1        RECV_INIT                                        !1      null
    5     2        BIND_STATIC                                              !2
    6     3      > SWITCH_STRING                                            !0, [ 'get':->9, 'set':->15, ], ->22
    7     4    >   IS_EQUAL                                                 !0, 'get'
          5      > JMPNZ                                                    ~3, ->9
    9     6    >   IS_EQUAL                                                 !0, 'set'
          7      > JMPNZ                                                    ~3, ->15
          8    > > JMP                                                      ->22
    8     9    >   INIT_FCALL                                               'spl_object_hash'
         10        FETCH_THIS                                       ~4      
         11        SEND_VAL                                                 ~4
         12        DO_ICALL                                         $5      
         13        FETCH_DIM_R                                      ~6      !2, $5
         14      > RETURN                                                   ~6
   10    15    >   INIT_FCALL                                               'spl_object_hash'
         16        FETCH_THIS                                       ~7      
         17        SEND_VAL                                                 ~7
         18        DO_ICALL                                         $8      
         19        ASSIGN_DIM                                               !2, $8
         20        OP_DATA                                                  !1
   11    21      > JMP                                                      ->26
   13    22    >   NEW                                              $10     'Exception'
         23        SEND_VAL_EX                                              'Wut+in+da+hell'
         24        DO_FCALL                                      0          
         25      > THROW                                         0          $10
   15    26    > > RETURN                                                   null

End of function key

End of class ZeroDayTechnique.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.96 ms | 1400 KiB | 21 Q