3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $files = array( '123.pdf', '123', '123.d.pdf', ); foreach($files as $file) { $fileBits = explode($file, '.'); $extension = $fileBits[count($fileBits-1)]; var_dump($fileBits); var_dump($extension); }
Output for 7.0.0 - 7.3.0beta1
Fatal error: Uncaught Error: Unsupported operand types in /in/pBWAG:9 Stack trace: #0 {main} thrown in /in/pBWAG on line 9
Process exited with code 255.
Output for hhvm-3.15.4
Fatal error: Invalid operand type was used: cannot perform this operation with arrays in /in/pBWAG on line 9
Process exited with code 255.
Output for 5.6.0 - 5.6.30
Fatal error: Unsupported operand types in /in/pBWAG on line 9
Process exited with code 255.