3v4l.org

run code in 300+ PHP versions simultaneously
<?php var_dump(decoct(umask(22))); $srcDir = '/tmp/files'; mkdir($srcDir); foreach([1, 2] as $i){ $file = tempnam($srcDir, 'test'); printf("File$i - %o\n", stat($file)['mode']); } $phar = new \PharData('/tmp/test.tar', null, null, \Phar::TAR); $phar->buildFromIterator(new \RecursiveDirectoryIterator($srcDir, \FilesystemIterator::SKIP_DOTS), $srcDir); $phar->addFile($file, 'added-with-add-file'); $phar->extractTo('/tmp/pharFiles'); foreach(new \RecursiveDirectoryIterator('/tmp/pharFiles', \FilesystemIterator::SKIP_DOTS) as $iFile) { printf('From ' . ($iFile->getFilename() === 'added-with-add-file' ? 'Iterator':'addFile'). " - %o\n", $iFile->getPerms()); }
Output for git.master_jit, git.master
string(2) "22" File1 - 100600 File2 - 100600 Deprecated: PharData::__construct(): Passing null to parameter #2 ($flags) of type int is deprecated in /in/fbqTl on line 9 From Iterator - 100600 From addFile - 100600 From addFile - 100600
Output for rfc.property-hooks
string(2) "22" File1 - 100600 File2 - 100600 Deprecated: PharData::__construct(): Passing null to parameter #2 ($flags) of type int is deprecated in /in/fbqTl on line 9 From addFile - 100600 From addFile - 100600 From Iterator - 100600

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