3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* 1. Create a file called test.txt 2. Zip that file into a file called test.zip 3. Uncomment the last line in this code 4. Run this code against PHP 7.4, 8.0 and 8.1 5. Note that 8.1 throws an exception */ class XYZ { private function getFilePointer($file) { $zip = new ZipArchive(); if (!$zip->open($file)) { throw new Exception("error"); } $fileName = 'test.txt'; if (!($stream = $zip->getStream($fileName))) { throw new Exception("error"); } return $stream; } public function doWork() { $stream = $this->getFilePointer('test.zip'); fgetcsv($stream); } } // Uncomment to run // (new XYZ())->doWork();
Output for git.master, git.master_jit, rfc.property-hooks

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:
105.71 ms | 405 KiB | 5 Q