3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dir = uniqid('/tmp/test_0700_'); mkdir($dir, 0700); $fileperms = 0777 & fileperms($dir); var_dump(0700 === $fileperms); var_dump(decoct($fileperms)); $dir = uniqid('/tmp/test_0770_'); mkdir($dir, 0770); $fileperms = 0777 & fileperms($dir); var_dump(0770 === $fileperms); var_dump(decoct($fileperms));
Output for 7.1.0 - 7.1.25, 7.2.0 - 7.2.13, 7.3.0 - 7.3.1
bool(true) string(3) "700" bool(false) string(3) "750"

preferences:
41.16 ms | 409 KiB | 5 Q