3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ZeroDayTechnique { public function key($action = 'get', $value = null) { static $hidden = null; switch ($action) { case 'get': return $hidden; case 'set': $hidden = $value; default: throw new Exception('Wut in da hell'); } } } $x = new ZeroDayTechnique; $x->key('set', random_bytes(32)); var_dump(bin2hex($x->key('get'))); var_dump($x);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/t8MUv
function name:  (null)
number of ops:  23
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   NEW                                              $1      'ZeroDayTechnique'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   19     3        INIT_METHOD_CALL                                         !0, 'key'
          4        SEND_VAL_EX                                              'set'
          5        INIT_FCALL                                               'random_bytes'
          6        SEND_VAL                                                 32
          7        DO_ICALL                                         $4      
          8        SEND_VAR_NO_REF_EX                                       $4
          9        DO_FCALL                                      0          
   21    10        INIT_FCALL                                               'var_dump'
         11        INIT_FCALL                                               'bin2hex'
         12        INIT_METHOD_CALL                                         !0, 'key'
         13        SEND_VAL_EX                                              'get'
         14        DO_FCALL                                      0  $6      
         15        SEND_VAR                                                 $6
         16        DO_ICALL                                         $7      
         17        SEND_VAR                                                 $7
         18        DO_ICALL                                                 
   23    19        INIT_FCALL                                               'var_dump'
         20        SEND_VAR                                                 !0
         21        DO_ICALL                                                 
         22      > RETURN                                                   1

Class ZeroDayTechnique:
Function key:
Finding entry points
Branch analysis from position: 0
4 jumps found. (Code = 188) Position 1 = 9, Position 2 = 10, Position 3 = 11, Position 4 = 4
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 11
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 = 10
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 10
Branch analysis from position: 9
filename:       /in/t8MUv
function name:  key
number of ops:  16
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':->10, ], ->11
    7     4    >   IS_EQUAL                                                 !0, 'get'
          5      > JMPNZ                                                    ~3, ->9
    9     6    >   IS_EQUAL                                                 !0, 'set'
          7      > JMPNZ                                                    ~3, ->10
          8    > > JMP                                                      ->11
    8     9    > > RETURN                                                   !2
   10    10    >   ASSIGN                                                   !2, !1
   12    11    >   NEW                                              $5      'Exception'
         12        SEND_VAL_EX                                              'Wut+in+da+hell'
         13        DO_FCALL                                      0          
         14      > THROW                                         0          $5
   14    15*     > RETURN                                                   null

End of function key

End of class ZeroDayTechnique.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.14 ms | 1400 KiB | 19 Q