3v4l.org

run code in 300+ PHP versions simultaneously
<?php $file = file_put_contents("/in/qF7aJ/myfile.txt", "testteststasfasdaskdjfbasdlkfbaslkdcjnbal;dfn"); $tmpFile = file_put_contents("/in/qF7aJ/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: file_put_contents(/in/qF7aJ/myfile.txt): Failed to open stream: No such file or directory in /in/YsVA6 on line 3 Warning: file_put_contents(/in/qF7aJ/mytmpfile.txt): Failed to open stream: No such file or directory in /in/YsVA6 on line 4 Fatal error: Uncaught ValueError: Path cannot be empty in /in/YsVA6:5 Stack trace: #0 /in/YsVA6(5): fopen('', 'r') #1 {main} thrown in /in/YsVA6 on line 5
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:
54.91 ms | 401 KiB | 8 Q