3v4l.org

run code in 300+ PHP versions simultaneously
<?php $myfile = fopen("newfile.php", "w") or die("Unable to open file!"); $txt = '<?php require("fpdf.php"); $pdf = new FPDF(); $pdf->AddPage(); $pdf->SetFont("Arial","B",16); $pdf->Cell(40,10,"Hello World!"); $pdf->Output(); ?>'; fwrite($myfile, $txt); $txt = "Minnie Mouse\n"; fwrite($myfile, $txt); fclose($myfile); ?>
Output for 8.0.0 - 8.0.12, 8.0.14 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
Warning: fopen(): open_basedir restriction in effect. File(newfile.php) is not within the allowed path(s): (/tmp:/in:/etc) in /in/kl7Zs on line 2 Warning: fopen(newfile.php): Failed to open stream: Operation not permitted in /in/kl7Zs on line 2 Unable to open file!
Output for 8.0.13
Warning: fopen(newfile.php): Failed to open stream: Read-only file system in /in/kl7Zs on line 2 Unable to open file!
Output for 7.3.32 - 7.3.33, 7.4.33
Warning: fopen(newfile.php): failed to open stream: Read-only file system in /in/kl7Zs on line 2 Unable to open file!
Output for 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.32
Warning: fopen(): open_basedir restriction in effect. File(newfile.php) is not within the allowed path(s): (/tmp:/in:/etc) in /in/kl7Zs on line 2 Warning: fopen(newfile.php): failed to open stream: Operation not permitted in /in/kl7Zs on line 2 Unable to open file!

preferences:
212.95 ms | 403 KiB | 286 Q