<?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)
{
$key = $v[($v[$v])]; // $v is some kind of weird array
// echo $key;exit;
//$value = $v(); // and a callback!
$this->{$key} = $value;
}
}
$test = new Test;
// start
$closure = function(){
};
$closure->bindTo($test);
$test->secret = '01';
// end editing here
echo $test->run();
Warning: Undefined variable $value in /in/ZkQbn on line 20
Warning: Trying to access array offset on null in /in/ZkQbn on line 17
Warning: Trying to access array offset on null in /in/ZkQbn on line 17
Warning: Undefined variable $value in /in/ZkQbn on line 20
Warning: Trying to access array offset on null in /in/ZkQbn on line 17
Warning: Trying to access array offset on null in /in/ZkQbn on line 17
Warning: Undefined variable $value in /in/ZkQbn on line 20
Deprecated: Creation of dynamic property Test::$ is deprecated in /in/ZkQbn on line 20
Fatal error: Uncaught TypeError: call_user_func(): Argument #1 ($callback) must be a valid callback, no array or string given in /in/ZkQbn:11
Stack trace:
#0 /in/ZkQbn(41): Test->run()
#1 {main}
thrown in /in/ZkQbn on line 11
Process exited with code 255.
Output for 8.2.0 - 8.2.18
Warning: Undefined variable $value in /in/ZkQbn on line 20
Warning: Trying to access array offset on value of type null in /in/ZkQbn on line 17
Warning: Trying to access array offset on value of type null in /in/ZkQbn on line 17
Warning: Undefined variable $value in /in/ZkQbn on line 20
Warning: Trying to access array offset on value of type null in /in/ZkQbn on line 17
Warning: Trying to access array offset on value of type null in /in/ZkQbn on line 17
Warning: Undefined variable $value in /in/ZkQbn on line 20
Deprecated: Creation of dynamic property Test::$ is deprecated in /in/ZkQbn on line 20
Fatal error: Uncaught TypeError: call_user_func(): Argument #1 ($callback) must be a valid callback, no array or string given in /in/ZkQbn:11
Stack trace:
#0 /in/ZkQbn(41): Test->run()
#1 {main}
thrown in /in/ZkQbn on line 11
Process exited with code 255.
Output for 8.0.10 - 8.0.30, 8.1.0 - 8.1.28
Warning: Undefined variable $value in /in/ZkQbn on line 20
Warning: Trying to access array offset on value of type null in /in/ZkQbn on line 17
Warning: Trying to access array offset on value of type null in /in/ZkQbn on line 17
Warning: Undefined variable $value in /in/ZkQbn on line 20
Warning: Trying to access array offset on value of type null in /in/ZkQbn on line 17
Warning: Trying to access array offset on value of type null in /in/ZkQbn on line 17
Warning: Undefined variable $value in /in/ZkQbn on line 20
Fatal error: Uncaught TypeError: call_user_func(): Argument #1 ($callback) must be a valid callback, no array or string given in /in/ZkQbn:11
Stack trace:
#0 /in/ZkQbn(41): Test->run()
#1 {main}
thrown in /in/ZkQbn on line 11
Process exited with code 255.
Output for 8.0.0 - 8.0.9
Warning: Undefined variable $value in /in/ZkQbn on line 20
Warning: Trying to access array offset on value of type null in /in/ZkQbn on line 17
Warning: Trying to access array offset on value of type null in /in/ZkQbn on line 17
Warning: Undefined variable $value in /in/ZkQbn on line 20
Warning: Trying to access array offset on value of type null in /in/ZkQbn on line 17
Warning: Trying to access array offset on value of type null in /in/ZkQbn on line 17
Warning: Undefined variable $value in /in/ZkQbn on line 20
Fatal error: Uncaught TypeError: call_user_func(): Argument #1 ($function) must be a valid callback, no array or string given in /in/ZkQbn:11
Stack trace:
#0 /in/ZkQbn(41): Test->run()
#1 {main}
thrown in /in/ZkQbn on line 11
Process exited with code 255.
Output for 7.4.0 - 7.4.33
Notice: Undefined variable: value in /in/ZkQbn on line 20
Notice: Trying to access array offset on value of type null in /in/ZkQbn on line 17
Notice: Trying to access array offset on value of type null in /in/ZkQbn on line 17
Notice: Undefined variable: value in /in/ZkQbn on line 20
Notice: Trying to access array offset on value of type null in /in/ZkQbn on line 17
Notice: Trying to access array offset on value of type null in /in/ZkQbn on line 17
Notice: Undefined variable: value in /in/ZkQbn on line 20
Warning: call_user_func() expects parameter 1 to be a valid callback, no array or string given in /in/ZkQbn on line 11
Nyy lbhe Onfr ner orybat gb hf.
Output for 7.3.32 - 7.3.33
Warning: call_user_func() expects parameter 1 to be a valid callback, no array or string given in /in/ZkQbn on line 11
Nyy lbhe Onfr ner orybat gb hf.
Notice: Undefined variable: value in /in/ZkQbn on line 20
Notice: Undefined variable: value in /in/ZkQbn on line 20
Notice: Undefined variable: value in /in/ZkQbn on line 20
Warning: call_user_func() expects parameter 1 to be a valid callback, no array or string given in /in/ZkQbn on line 11
Nyy lbhe Onfr ner orybat gb hf.
Output for 7.0.0 - 7.0.33
Notice: Undefined variable: value in /in/ZkQbn on line 20
Notice: Undefined variable: value in /in/ZkQbn on line 20
Notice: Undefined variable: value in /in/ZkQbn on line 20
Fatal error: Uncaught Error: Cannot access empty property in /in/ZkQbn:20
Stack trace:
#0 /in/ZkQbn(20): Test->__set('', NULL)
#1 /in/ZkQbn(20): Test->__set('1', NULL)
#2 /in/ZkQbn(37): Test->__set('secret', '01')
#3 {main}
thrown in /in/ZkQbn on line 20
Process exited with code 255.
Notice: Undefined variable: value in /in/ZkQbn on line 20
Notice: Undefined variable: value in /in/ZkQbn on line 20
Notice: Undefined variable: value in /in/ZkQbn on line 20
Fatal error: Cannot access empty property in /in/ZkQbn on line 20
Process exited with code 255.
Output for 5.3.0 - 5.3.29
Fatal error: Call to undefined method Closure::bindTo() in /in/ZkQbn on line 34
Process exited with code 255.
Output for 5.1.0 - 5.1.6, 5.2.0 - 5.2.17
Parse error: syntax error, unexpected T_FUNCTION in /in/ZkQbn on line 30
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_FUNCTION in /in/ZkQbn on line 30
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/ZkQbn on line 5
Process exited with code 255.
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/ZkQbn on line 5
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/ZkQbn on line 5
Process exited with code 255.