3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { private $secret = 'Nyy lbhe Onfr ner orybat gb hf.'; private $callback; final public function run() { call_user_func($this->callback); return $this->secret . PHP_EOL; } public function __set($k, $v) { print_r($v);exit; $key = $v[($v[$v])]; // $v is some kind of weird array $value = $v(); // and a callback! $this->{$key} = $value; } } $test = new Test; // start editing here // key needs to = 'callback', with a $v being a function which changes secret // the value $v[($v[$v])] needs to equal callback // v must be an array with a $vee = array('1'); $vee = array('callback', '13'); // end editing here echo $test->run();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/R4AC7
function name:  (null)
number of ops:  9
compiled vars:  !0 = $test, !1 = $vee
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   NEW                                              $2      'Test'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   33     3        ASSIGN                                                   !1, <array>
   35     4        ASSIGN                                                   !1, <array>
   39     5        INIT_METHOD_CALL                                         !0, 'run'
          6        DO_FCALL                                      0  $7      
          7        ECHO                                                     $7
          8      > RETURN                                                   1

Class Test:
Function run:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/R4AC7
function name:  run
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   FETCH_OBJ_R                                      ~0      'callback'
          1        INIT_USER_CALL                                0          'call_user_func', ~0
          2        DO_FCALL                                      0          
   11     3        FETCH_OBJ_R                                      ~2      'secret'
          4        CONCAT                                           ~3      ~2, '%0A'
          5      > RETURN                                                   ~3
   12     6*     > RETURN                                                   null

End of function run

Function __set:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 79) Position 1 = -2
filename:       /in/R4AC7
function name:  __set
number of ops:  15
compiled vars:  !0 = $k, !1 = $v, !2 = $key, !3 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   16     2        INIT_FCALL                                               'print_r'
          3        SEND_VAR                                                 !1
          4        DO_ICALL                                                 
          5      > EXIT                                                     
   17     6*       FETCH_DIM_R                                      ~5      !1, !1
          7*       FETCH_DIM_R                                      ~6      !1, ~5
          8*       ASSIGN                                                   !2, ~6
   18     9*       INIT_DYNAMIC_CALL                                        !1
         10*       DO_FCALL                                      0  $8      
         11*       ASSIGN                                                   !3, $8
   19    12*       ASSIGN_OBJ                                               !2
         13*       OP_DATA                                                  !3
   20    14*     > RETURN                                                   null

End of function __set

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.1 ms | 1396 KiB | 15 Q