3v4l.org

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

Function dostuff:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8dE5Y
function name:  dostuff
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   30     0  E > > RETURN                                                   'doing+stuff'
   31     1*     > RETURN                                                   null

End of function dostuff

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

End of function run

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.8 ms | 1393 KiB | 13 Q