3v4l.org

run code in 300+ PHP versions simultaneously
<?php $DoB1 = '14/01/02'; $DoB1match = preg_match("/([0-2]\d|3[0-1])\/(0\d|1[0-2])\/\d{2}/", $DoB1); // Check pattern $age1 = DateTime::createFromFormat('d/m/y', $DoB1) ->diff(new DateTime('now')) ->y; // Check age $age1OK = $age1 > 4 && $age1 < 14; // Check age greater than 4 but less than 14 $DoB1Valid = $DoB1match && $age1OK; if ($age1OK == true) { echo 'yeah'; } else { echo 'nah'; }
Output for git.master, git.master_jit, rfc.property-hooks
yeah

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