3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $files = glob("/tmp/sess_*"); $users = array(); foreach( $files as $file ){ $owner = fileowner($file); $user = posix_getpwuid($owner); if( !in_array( $user, $users ) ){ $users[] = $user; } } foreach( $users as $user ){ $info = str_replace( ' ', ' ', print_r($user,true)); echo nl2br($info); } ?>
Output for 4.3.0 - 4.3.6, 4.3.9 - 5.5.24, 5.6.28, 7.0.14 - 7.1.0
Output for 5.5.25 - 5.6.21, hhvm-3.12.0, 7.0.0 - 7.0.6
Array<br /> (<br /> [name] => nobody<br /> [passwd] => x<br /> [uid] => 99<br /> [gid] => 99<br /> [gecos] => nobody<br /> [dir] => /<br /> [shell] => /usr/bin/nologin<br /> )<br />
Output for hhvm-3.10.0

Process exited with code 153.
Output for 4.3.7 - 4.3.8
Warning: Invalid argument supplied for foreach() in /in/JTSHA on line 4