3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php echo php_uname(); echo PHP_OS; /* Some possible outputs: Linux localhost 2.4.21-0.13mdk #1 Fri Mar 14 15:08:06 EST 2003 i686 Linux FreeBSD localhost 3.2-RELEASE #15: Mon Dec 17 08:46:02 GMT 2001 FreeBSD Windows NT XN1 5.1 build 2600 WINNT */ if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { echo 'This is a server using Windows!'; } else { echo 'This is a server not using Windows!'; } ?>
Output for 7.1.0
Linux php_shell 4.8.11-1-ARCH #1 SMP PREEMPT Sun Nov 27 09:26:14 CET 2016 x86_64LinuxThis is a server not using Windows!
Output for 5.6.28, 7.0.14
Linux php_shell 4.8.6-1-ARCH #1 SMP PREEMPT Mon Oct 31 18:51:30 CET 2016 x86_64LinuxThis is a server not using Windows!
Output for 4.3.0 - 5.6.22, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.0.7
Linux php_shell 4.6.2-1-ARCH #1 SMP PREEMPT Wed Jun 8 08:40:59 CEST 2016 x86_64LinuxThis is a server not using Windows!