3v4l.org

run code in 300+ PHP versions simultaneously
<?php protected function moveFile($file){ foreach ($file['file1']['tmp_name'] as $key=>$tmp_name){ $date = new DateTime(); $info = new SplFileInfo($file["file1"]["name"][$key]); $file_name=$_SESSION['user_details']['user_id'].'-'.$date->getTimestamp().'-'.sha1($file["file1"]["name"][$key]).'.'.$info->getExtension(); $file_tmp=$file["file1"]["tmp_name"][$key]; $success=move_uploaded_file($file_tmp,$this->directory.$file_name); var_dump($file_name); }
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.23, 8.4.1 - 8.4.10
Parse error: syntax error, unexpected token "protected", expecting end of file in /in/jVRZ1 on line 3
Process exited with code 255.
Output for 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.34, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
Parse error: syntax error, unexpected 'protected' (T_PROTECTED), expecting end of file in /in/jVRZ1 on line 3
Process exited with code 255.
Output for 5.5.0 - 5.5.38, 5.6.0 - 5.6.40
Parse error: syntax error, unexpected 'protected' (T_PROTECTED) in /in/jVRZ1 on line 3
Process exited with code 255.

preferences:
172.03 ms | 2687 KiB | 6 Q