3v4l.org

run code in 300+ PHP versions simultaneously
<?php $pathA = '/tmp/a.txt'; $pathB = '/tmp/b.txt'; file_put_contents($pathA, 'X'); file_put_contents($pathB, 'X'); $handleA = fopen($pathA, 'a+'); $handleB = fopen($pathB, 'a+'); assert(fwrite($handleA, 'Y') === fwrite($handleB, 'Y')); fseek($handleA, ftell($handleA)); // THIS LINE SHOULD DO NOTHING BUT CHANGES THE BEHAVIOR assert(ftell($handleA) === ftell($handleB)); $contentA = fread($handleA, 100); $contentB = fread($handleB, 100); var_dump($contentA); var_dump($contentB); assert($contentA === $contentB);
Output for git.master_jit, git.master, rfc.property-hooks
string(1) "Y" string(0) "" Fatal error: Uncaught AssertionError: assert($contentA === $contentB) in /in/gTXsR:22 Stack trace: #0 /in/gTXsR(22): assert(false, 'assert($content...') #1 {main} thrown in /in/gTXsR on line 22
Process exited with code 255.

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