3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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
Jump found. Position 1 = -2
filename:       /in/R4AC7
function name:  (null)
number of ops:  10
compiled vars:  !0 = $test, !1 = $vee
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   2     0  E >   NOP                                                      
  25     1        NEW                                              $3      :-6
         2        DO_FCALL                                      0          
         3        ASSIGN                                                   !0, $3
  33     4        ASSIGN                                                   !1, <array>
  35     5        ASSIGN                                                   !1, <array>
  39     6        INIT_METHOD_CALL                                         !0, 'run'
         7        DO_FCALL                                      0  $8      
         8        ECHO                                                     $8
         9      > RETURN                                                   1

Class Test:
Function run:
Finding entry points
Branch analysis from position: 0
Jump found. 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
Jump found. 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 7.2.0