3v4l.org

run code in 300+ PHP versions simultaneously
<?php function sugar_unserialize($value) { preg_match('/[oc]:\d+:/i', $value, $matches); if (count($matches)) { return false; } return unserialize($value); } $test1 = 'O:8:"stdClass":0:{}'; $test2 = 'O:+8:"stdClass":0:{}'; var_dump(sugar_unserialize($test1), sugar_unserialize($test2));
Output for git.master, git.master_jit
Notice: unserialize(): Error at offset 0 of 20 bytes in /in/oc2cY on line 11 bool(false) bool(false)
Output for rfc.property-hooks
Warning: unserialize(): Error at offset 0 of 20 bytes in /in/oc2cY on line 11 bool(false) bool(false)

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:
34.83 ms | 406 KiB | 5 Q