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(); } } $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);

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.4.20.0100.01021.39
8.4.10.0350.01417.52
8.3.150.0110.00417.36
8.3.140.0390.00716.50
8.3.130.0270.00416.39
8.3.120.0320.01116.56
8.3.110.0310.00916.69
8.3.100.0290.01916.39
8.3.90.0430.00316.68
8.3.80.0380.01116.66
8.3.70.0340.01116.58
8.3.60.0420.00316.66
8.3.50.0330.01116.45
8.3.40.0310.01217.45
8.3.30.0270.00917.50
8.3.20.0330.00717.28
8.3.10.0300.01017.50
8.3.00.0220.00017.41
8.2.270.0150.00316.89
8.2.260.0350.00316.32
8.2.250.0250.01416.26
8.2.240.0310.00816.51
8.2.230.0270.01216.46
8.2.220.0320.00616.42
8.2.210.0320.00616.21
8.2.200.0390.00616.45
8.2.190.0350.00316.15
8.2.180.0340.00316.31
8.2.170.0400.00417.65
8.2.160.0300.01217.72
8.2.150.0320.00417.49
8.2.140.0240.00717.53
8.2.130.0350.00717.55
8.2.120.0300.01117.60
8.2.110.0230.01917.67
8.2.100.0360.00417.63
8.2.90.0360.00317.57
8.2.80.0380.00317.38
8.2.70.0430.00017.20
8.2.60.0250.00717.45
8.2.50.0240.01017.25
8.2.40.0320.00717.67
8.2.30.0350.00617.34
8.2.20.0180.01817.51
8.2.10.0230.00817.62
8.2.00.0340.00417.31

preferences:
26.84 ms | 403 KiB | 5 Q