3v4l.org

run code in 300+ PHP versions simultaneously
<?php $agent = "Mozilla/5.0 (iPad; CPU OS 10_3_2 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) CriOS/59.0.3071.102 Mobile/14F89 Safari/602.1"; echo 'v3.6.5 '; preg_match('|CriOS[/ ]([0-9.]+)|', $agent, $version); var_dump($version); list ($majorVersion, $minorVersion) = explode('.', $version[1]); echo 'v3.7.3 '; preg_match('/Chrome|CrMo|CriOS[\/ ]([0-9.]+)/i', $agent, $version); var_dump($version); list ($majorVersion, $minorVersion) = explode('.', $version[2]);
Output for 8.1.0 - 8.1.27, 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
v3.6.5 array(2) { [0]=> string(19) "CriOS/59.0.3071.102" [1]=> string(13) "59.0.3071.102" } v3.7.3 array(2) { [0]=> string(19) "CriOS/59.0.3071.102" [1]=> string(13) "59.0.3071.102" } Warning: Undefined array key 2 in /in/YpmNB on line 13 Deprecated: explode(): Passing null to parameter #2 ($string) of type string is deprecated in /in/YpmNB on line 13 Warning: Undefined array key 1 in /in/YpmNB on line 13
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 v3.6.5 array(2) { [0]=> string(19) "CriOS/59.0.3071.102" [1]=> string(13) "59.0.3071.102" } v3.7.3 array(2) { [0]=> string(19) "CriOS/59.0.3071.102" [1]=> string(13) "59.0.3071.102" } Warning: Undefined array key 2 in /in/YpmNB on line 13 Deprecated: explode(): Passing null to parameter #2 ($string) of type string is deprecated in /in/YpmNB on line 13 Warning: Undefined array key 1 in /in/YpmNB on line 13
Output for 8.0.0 - 8.0.30
v3.6.5 array(2) { [0]=> string(19) "CriOS/59.0.3071.102" [1]=> string(13) "59.0.3071.102" } v3.7.3 array(2) { [0]=> string(19) "CriOS/59.0.3071.102" [1]=> string(13) "59.0.3071.102" } Warning: Undefined array key 2 in /in/YpmNB on line 13 Warning: Undefined array key 1 in /in/YpmNB on line 13
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.16 - 7.3.31, 7.4.0 - 7.4.33
v3.6.5 array(2) { [0]=> string(19) "CriOS/59.0.3071.102" [1]=> string(13) "59.0.3071.102" } v3.7.3 array(2) { [0]=> string(19) "CriOS/59.0.3071.102" [1]=> string(13) "59.0.3071.102" } Notice: Undefined offset: 2 in /in/YpmNB on line 13 Notice: Undefined offset: 1 in /in/YpmNB on line 13
Output for 7.3.32 - 7.3.33
v3.6.5 array(2) { [0]=> string(19) "CriOS/59.0.3071.102" [1]=> string(13) "59.0.3071.102" } v3.7.3 array(2) { [0]=> string(19) "CriOS/59.0.3071.102" [1]=> string(13) "59.0.3071.102" }

preferences:
131.3 ms | 401 KiB | 172 Q