3v4l.org

run code in 300+ PHP versions simultaneously
<?php function ReformatPhoneNumber($number) { if(strlen($number) > 12 || strlen($number) < 7) throw new Exception("Invalid phone number"); if(preg_match('/^\d+(\d-\d)?\d*(\d\s\d)?\d+$/', $number) === 1) return str_replace(array('-', ' '), '', $number); } //echo ReformatPhoneNumber('012345'); function MaxArray(array $arr) { $max = 0; foreach($arr as $element) { if(is_array($element)) $max = MaxArray($element) > $max ? MaxArray($element) : $max; $max = $element > $max ? $element : $max; } return $max; } $arr = array(array(141,151,161), 2, 3, array(101, 202, array(303,404))); echo MaxArray($arr);
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Array to string conversion in /in/qaWaB on line 24 Array

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