3v4l.org

run code in 300+ PHP versions simultaneously
<?Php $file_upload="true"; $file_up_size=$_FILES['file_up'][size]; echo $_FILES[file_up][name]; if ($_FILES[file_up][size]>250000){$msg=$msg."Your uploaded file size is more than 250KB so please reduce the file size and then upload.<BR>"; $file_upload="false";} if (!($_FILES[file_up][type] =="image/jpeg" OR $_FILES[file_up][type] =="image/gif")) {$msg=$msg."Your uploaded file must be of JPG or GIF. Other file types are not allowed<BR>"; $file_upload="false";} $file_name=$_FILES[file_up][name]; $add="upload/$file_name"; // the path with the file name where the file will be stored if($file_upload=="true"){ if(move_uploaded_file ($_FILES[file_up][tmp_name], $add)){ // do your coding here to give a thanks message or any other thing. }else{echo "Failed to upload file Contact Site admin to fix the problem";} }else{ echo $msg; } ?>
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Fatal error: Uncaught Error: Undefined constant "size" in /in/EMa4H:4 Stack trace: #0 {main} thrown in /in/EMa4H on line 4
Process exited with code 255.
Output for 7.4.0 - 7.4.33
Warning: Use of undefined constant size - assumed 'size' (this will throw an Error in a future version of PHP) in /in/EMa4H on line 4 Notice: Undefined index: file_up in /in/EMa4H on line 4 Notice: Trying to access array offset on value of type null in /in/EMa4H on line 4 Warning: Use of undefined constant file_up - assumed 'file_up' (this will throw an Error in a future version of PHP) in /in/EMa4H on line 5 Warning: Use of undefined constant name - assumed 'name' (this will throw an Error in a future version of PHP) in /in/EMa4H on line 5 Notice: Undefined index: file_up in /in/EMa4H on line 5 Notice: Trying to access array offset on value of type null in /in/EMa4H on line 5 Warning: Use of undefined constant file_up - assumed 'file_up' (this will throw an Error in a future version of PHP) in /in/EMa4H on line 6 Warning: Use of undefined constant size - assumed 'size' (this will throw an Error in a future version of PHP) in /in/EMa4H on line 6 Notice: Undefined index: file_up in /in/EMa4H on line 6 Notice: Trying to access array offset on value of type null in /in/EMa4H on line 6 Warning: Use of undefined constant file_up - assumed 'file_up' (this will throw an Error in a future version of PHP) in /in/EMa4H on line 10 Warning: Use of undefined constant type - assumed 'type' (this will throw an Error in a future version of PHP) in /in/EMa4H on line 10 Notice: Undefined index: file_up in /in/EMa4H on line 10 Notice: Trying to access array offset on value of type null in /in/EMa4H on line 10 Warning: Use of undefined constant file_up - assumed 'file_up' (this will throw an Error in a future version of PHP) in /in/EMa4H on line 10 Warning: Use of undefined constant type - assumed 'type' (this will throw an Error in a future version of PHP) in /in/EMa4H on line 10 Notice: Undefined index: file_up in /in/EMa4H on line 10 Notice: Trying to access array offset on value of type null in /in/EMa4H on line 10 Notice: Undefined variable: msg in /in/EMa4H on line 11 Warning: Use of undefined constant file_up - assumed 'file_up' (this will throw an Error in a future version of PHP) in /in/EMa4H on line 14 Warning: Use of undefined constant name - assumed 'name' (this will throw an Error in a future version of PHP) in /in/EMa4H on line 14 Notice: Undefined index: file_up in /in/EMa4H on line 14 Notice: Trying to access array offset on value of type null in /in/EMa4H on line 14 Your uploaded file must be of JPG or GIF. Other file types are not allowed<BR>
Output for 7.3.32 - 7.3.33
Warning: Use of undefined constant size - assumed 'size' (this will throw an Error in a future version of PHP) in /in/EMa4H on line 4 Warning: Use of undefined constant file_up - assumed 'file_up' (this will throw an Error in a future version of PHP) in /in/EMa4H on line 5 Warning: Use of undefined constant name - assumed 'name' (this will throw an Error in a future version of PHP) in /in/EMa4H on line 5 Warning: Use of undefined constant file_up - assumed 'file_up' (this will throw an Error in a future version of PHP) in /in/EMa4H on line 6 Warning: Use of undefined constant size - assumed 'size' (this will throw an Error in a future version of PHP) in /in/EMa4H on line 6 Warning: Use of undefined constant file_up - assumed 'file_up' (this will throw an Error in a future version of PHP) in /in/EMa4H on line 10 Warning: Use of undefined constant type - assumed 'type' (this will throw an Error in a future version of PHP) in /in/EMa4H on line 10 Warning: Use of undefined constant file_up - assumed 'file_up' (this will throw an Error in a future version of PHP) in /in/EMa4H on line 10 Warning: Use of undefined constant type - assumed 'type' (this will throw an Error in a future version of PHP) in /in/EMa4H on line 10 Warning: Use of undefined constant file_up - assumed 'file_up' (this will throw an Error in a future version of PHP) in /in/EMa4H on line 14 Warning: Use of undefined constant name - assumed 'name' (this will throw an Error in a future version of PHP) in /in/EMa4H on line 14 Your uploaded file must be of JPG or GIF. Other file types are not allowed<BR>
Output for 7.2.0 - 7.2.33, 7.3.16 - 7.3.31
Warning: Use of undefined constant size - assumed 'size' (this will throw an Error in a future version of PHP) in /in/EMa4H on line 4 Notice: Undefined index: file_up in /in/EMa4H on line 4 Warning: Use of undefined constant file_up - assumed 'file_up' (this will throw an Error in a future version of PHP) in /in/EMa4H on line 5 Warning: Use of undefined constant name - assumed 'name' (this will throw an Error in a future version of PHP) in /in/EMa4H on line 5 Notice: Undefined index: file_up in /in/EMa4H on line 5 Warning: Use of undefined constant file_up - assumed 'file_up' (this will throw an Error in a future version of PHP) in /in/EMa4H on line 6 Warning: Use of undefined constant size - assumed 'size' (this will throw an Error in a future version of PHP) in /in/EMa4H on line 6 Notice: Undefined index: file_up in /in/EMa4H on line 6 Warning: Use of undefined constant file_up - assumed 'file_up' (this will throw an Error in a future version of PHP) in /in/EMa4H on line 10 Warning: Use of undefined constant type - assumed 'type' (this will throw an Error in a future version of PHP) in /in/EMa4H on line 10 Notice: Undefined index: file_up in /in/EMa4H on line 10 Warning: Use of undefined constant file_up - assumed 'file_up' (this will throw an Error in a future version of PHP) in /in/EMa4H on line 10 Warning: Use of undefined constant type - assumed 'type' (this will throw an Error in a future version of PHP) in /in/EMa4H on line 10 Notice: Undefined index: file_up in /in/EMa4H on line 10 Notice: Undefined variable: msg in /in/EMa4H on line 11 Warning: Use of undefined constant file_up - assumed 'file_up' (this will throw an Error in a future version of PHP) in /in/EMa4H on line 14 Warning: Use of undefined constant name - assumed 'name' (this will throw an Error in a future version of PHP) in /in/EMa4H on line 14 Notice: Undefined index: file_up in /in/EMa4H on line 14 Your uploaded file must be of JPG or GIF. Other file types are not allowed<BR>
Output for 5.4.2 - 5.4.45, 5.5.24 - 5.5.35, 5.6.7 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.20
Notice: Use of undefined constant size - assumed 'size' in /in/EMa4H on line 4 Notice: Undefined index: file_up in /in/EMa4H on line 4 Notice: Use of undefined constant file_up - assumed 'file_up' in /in/EMa4H on line 5 Notice: Use of undefined constant name - assumed 'name' in /in/EMa4H on line 5 Notice: Undefined index: file_up in /in/EMa4H on line 5 Notice: Use of undefined constant file_up - assumed 'file_up' in /in/EMa4H on line 6 Notice: Use of undefined constant size - assumed 'size' in /in/EMa4H on line 6 Notice: Undefined index: file_up in /in/EMa4H on line 6 Notice: Use of undefined constant file_up - assumed 'file_up' in /in/EMa4H on line 10 Notice: Use of undefined constant type - assumed 'type' in /in/EMa4H on line 10 Notice: Undefined index: file_up in /in/EMa4H on line 10 Notice: Use of undefined constant file_up - assumed 'file_up' in /in/EMa4H on line 10 Notice: Use of undefined constant type - assumed 'type' in /in/EMa4H on line 10 Notice: Undefined index: file_up in /in/EMa4H on line 10 Notice: Undefined variable: msg in /in/EMa4H on line 11 Notice: Use of undefined constant file_up - assumed 'file_up' in /in/EMa4H on line 14 Notice: Use of undefined constant name - assumed 'name' in /in/EMa4H on line 14 Notice: Undefined index: file_up in /in/EMa4H on line 14 Your uploaded file must be of JPG or GIF. Other file types are not allowed<BR>

preferences:
190.17 ms | 405 KiB | 227 Q