3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* Challenge 1: Modify Test::$secret before it's output. Rules:: 1. No use of Reflection API / runkit extension 2. No stopping execution before Test::run() 3. No Exceptions or PHP errors / warnings notices allowed Hints: 1. Caesar 2. Magic methods 3. Requires a new feature of PHP 5.4 */ 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) //{ // $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 //$test->$callback = $test->__set($test, 'Lbhe Onfr orybatf gb zr abj'); $test->secret = 'Lbhe Onfr orybatf gb zr abj'; // end editing here echo $test->run();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/T1kGX
function name:  (null)
number of ops:  9
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   41     0  E >   NEW                                              $1      'Test'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   47     3        ASSIGN_OBJ                                               !0, 'secret'
          4        OP_DATA                                                  'Lbhe+Onfr+orybatf+gb+zr+abj'
   51     5        INIT_METHOD_CALL                                         !0, 'run'
          6        DO_FCALL                                      0  $5      
          7        ECHO                                                     $5
          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/T1kGX
function name:  run
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   28     0  E >   FETCH_OBJ_R                                      ~0      'secret'
          1        CONCAT                                           ~1      ~0, '%0A'
          2      > RETURN                                                   ~1
   29     3*     > RETURN                                                   null

End of function run

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.33 ms | 1393 KiB | 13 Q