3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arrAgent = array( 'sony', 'symbian', 'nokia', 'samsung', 'mobile', 'windows ce', 'blackberry', 'ericsson', 'danger', 'palm', 'series60', 'palmsource', 'pocketpc', 'smartphone', 'vodafone', 'iphone', 'android', 'ipad' ); $agent = 'mozilla/5.0 (ipad; u; cpu os 4_3_2 like mac os x; en-us) applewebkit/533.17.9 (khtml, like gecko) version/5.0.2 mobile/8h7 safari/6533.18.5'; $pattern = '/((' . implode(')|(', $arrAgent) . '))/'; $found = preg_match($pattern, $agent, $matches); if (!$found) { print 'not a mobile device'; exit; } print 'device: ' . $matches[0];
Output for git.master, git.master_jit, rfc.property-hooks
device: ipad

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