3v4l.org

run code in 300+ PHP versions simultaneously
<?php $file = file_put_contents("/tmp/myfile.txt", "testteststasfasdaskdjfbasdlkfbaslkdcjnbal;dfn"); $tmpFile = file_put_contents("/tmp/mytmpfile.txt",""); $old = fopen($file, 'r'); $new = fopen($tmpFile, 'w'); while (!feof($old)) { // Your search subject $subject = ''; // Get $numChars for($x = 0, $numChars = 100; $x < $numChars; $x++){ $subject .= fgetc($old); } // Replace and write to $new fwrite($new, preg_replace('/[^\P{Cc}\t\r\n]/u', '', $subject)); // Clean out the characters $subject = ''; } rename($tmpFile, $file);
Output for git.master, git.master_jit, rfc.property-hooks
Warning: fopen(): open_basedir restriction in effect. File(45) is not within the allowed path(s): (/tmp:/in:/etc) in /in/qF7aJ on line 5 Warning: fopen(45): Failed to open stream: Operation not permitted in /in/qF7aJ on line 5 Warning: fopen(): open_basedir restriction in effect. File(0) is not within the allowed path(s): (/tmp:/in:/etc) in /in/qF7aJ on line 6 Warning: fopen(0): Failed to open stream: Operation not permitted in /in/qF7aJ on line 6 Fatal error: Uncaught TypeError: feof(): Argument #1 ($stream) must be of type resource, false given in /in/qF7aJ:8 Stack trace: #0 /in/qF7aJ(8): feof(false) #1 {main} thrown in /in/qF7aJ on line 8
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:
34.99 ms | 402 KiB | 8 Q