3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public $key; public $link; function __destruct() { global $flag; global $permit; if($permit==1) echo $flag; } function __wakeup() { exit("nonono"); } } class B { public $key; public $link; function __destruct() { global $file; global $flag; $flag="get_flag_contents"; } function __wakeup() { global $file; $this->key=1; $file='index.php'; } function __toString() { if($link->key==0){ global $file; $file='flag.php'; return "WOW!!!"; } } } class C { public $key; public $link; function __destruct() { if($this->link->key==1) echo $this->link; } function __wakeup() { exit("nonono"); } } class D { public $key; public $link; function __destruct() { global $permit; $permit=1; $this->key=0; echo "OK!YOU CAN PASS"; } function __wakeup() { exit("nonono"); } } class E { public $key; public $link; function __destruct() { global $permit; $permit=0; } function __wakeup() { $this->key=0; phpinfo(); } } unserialize($_GET['yoyo']); class A { public $key; public $link; function __destruct() { global $flag; global $permit; if($permit==1) echo $flag; } function __wakeup() { exit("nonono"); } } class B { public $key; public $link; function __destruct() { global $file; global $flag; $flag=base64_encode(file_get_contents($file)); } function __wakeup() { global $file; $this->key=1; $file='index.php'; } function __toString() { if($link->key==0){ global $file; $file='flag.php'; return "WOW!!!"; } } } class C { public $key; public $link; function __destruct() { if($this->link->key==1) echo $this->link; } function __wakeup() { exit("nonono"); } } class D { public $key; public $link; function __destruct() { global $permit; $permit=1; $this->key=0; echo "OK!YOU CAN PASS"; } function __wakeup() { exit("nonono"); } } class E { public $key; public $link; function __destruct() { global $permit; $permit=0; } function __wakeup() { $this->key=0; phpinfo(); } } unserialize($_GET['yoyo']);class A { public $key; public $link; function __destruct() { global $flag; global $permit; if($permit==1) echo $flag; } function __wakeup() { exit("nonono"); } } class B { public $key; public $link; function __destruct() { global $file; global $flag; $flag=base64_encode(file_get_contents($file)); } function __wakeup() { global $file; $this->key=1; $file='index.php'; } function __toString() { if($link->key==0){ global $file; $file='flag.php'; return "WOW!!!"; } } } class C { public $key; public $link; function __destruct() { if($this->link->key==1) echo $this->link; } function __wakeup() { exit("nonono"); } } class D { public $key; public $link; function __destruct() { global $permit; $permit=1; $this->key=0; echo "OK!YOU CAN PASS"; } function __wakeup() { exit("nonono"); } } class E { public $key; public $link; function __destruct() { global $permit; $permit=0; } function __wakeup() { $this->key=0; phpinfo(); } } $ser = 'O:1:"C":2:{s:3:"key";N;s:4:"link";O:1:"B":2:{s:3:"key";i:1;s:4:"link";N;}}'; unserialize($ser);
Output for git.master_jit, git.master
Warning: Undefined array key "yoyo" in /in/ZhvrI on line 72 Deprecated: unserialize(): Passing null to parameter #1 ($data) of type string is deprecated in /in/ZhvrI on line 72 Fatal error: Cannot redeclare class A (previously declared in /in/ZhvrI:2) in /in/ZhvrI on line 73
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
23.23 ms | 405 KiB | 5 Q