3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php // Move the temporary uploaded file to its final location, // it should be available at the location "/tmp/boxed/success/agentSvcfRiuOSj5em1t.pdf". $path = '/tmp/boxed/success/'; $mimes = [ 'application/pdf', 'application/x-pdf' ]; $file = $_FILES['agentSvcfRiuOSj5em1t.pdf']; $fileName = $file['name']; if (file_exists($file['name'])) { throw new \Exception('file does not exist'); } if (in_array($mimes,$file['mime'])) { throw new \Exception('mime type not allowed'); } do_move($file['name'], $path.$fileName); ?>
based on ZVR12
Output for 7.0.0 - 7.3.0rc2
Notice: Undefined index: agentSvcfRiuOSj5em1t.pdf in /in/NYPTV on line 13 Warning: in_array() expects parameter 2 to be array, null given in /in/NYPTV on line 20 Fatal error: Uncaught Error: Call to undefined function do_move() in /in/NYPTV:24 Stack trace: #0 {main} thrown in /in/NYPTV on line 24
Process exited with code 255.
Output for hhvm-3.12.14 - 3.17.3
Notice: Undefined index: agentSvcfRiuOSj5em1t.pdf in /in/NYPTV on line 13 Warning: file_exists() expects parameter 1 to be string, null given in /in/NYPTV on line 16 Warning: in_array() expects parameter 2 to be an array or collection in /in/NYPTV on line 20 Fatal error: Uncaught Error: Call to undefined function do_move() in /in/NYPTV:24 Stack trace: #0 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.30
Notice: Undefined index: agentSvcfRiuOSj5em1t.pdf in /in/NYPTV on line 13 Warning: in_array() expects parameter 2 to be array, null given in /in/NYPTV on line 20 Fatal error: Call to undefined function do_move() in /in/NYPTV on line 24
Process exited with code 255.