3v4l.org

run code in 300+ PHP versions simultaneously
<?php class UserNotFoundException extends \Exception {} function check_user_exists($user_id) { // check user account hasn't been deleted, otherwise throw: throw new UserNotFoundException("exceptions for flow control are great.\n"); } class User { private $id = 5; function __unserialize(array $data) { check_user_exists($data["\x00User\x00id"]); } } $user = new User(); $data = serialize($user); echo "$data \n"; try { $result = unserialize($data); } catch (UserNotFoundException $unfe) { echo "redirect user to login page\n"; exit(0); } echo "User is valid.\n";
Output for git.master, git.master_jit, rfc.property-hooks
O:4:"User":1:{s:8:"Userid";i:5;} redirect user to login page

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:
30.6 ms | 401 KiB | 8 Q