3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $info = new SplFileInfo('php://temp'); $obj = new SplFileObject('php://memory'); $tmp = new SplTempFileObject; if ($obj instanceof SplFileInfo) { echo 'SplFileObject IS an instanceof SplFileInfo', PHP_EOL; } else { echo 'SplFileObject IS NOT an instanceof SplFileInfo', PHP_EOL; } if ($tmp instanceof SplFileObject) { echo 'SplTempFileObject IS an instanceof SplFileObject', PHP_EOL; } else { echo 'SplTempFileObject IS NOT an instanceof SplFileObject', PHP_EOL; } if ($tmp instanceof SplFileInfo) { echo 'SplTempFileObject IS an instanceof SplFileInfo', PHP_EOL; } else { echo 'SplTempFileObject IS NOT an instanceof SplFileInfo', PHP_EOL; }
Output for 5.1.4 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
SplFileObject IS an instanceof SplFileInfo SplTempFileObject IS an instanceof SplFileObject SplTempFileObject IS an instanceof SplFileInfo
Output for 5.1.2 - 5.1.3
Fatal error: Uncaught exception 'RuntimeException' with message 'SplFileObject::__construct(php://memory): failed to open stream: Inappropriate ioctl for device' in /in/jsDNX:4 Stack trace: #0 /in/jsDNX(4): SplFileObject->__construct('php://memory') #1 {main} thrown in /in/jsDNX on line 4
Process exited with code 255.
Output for 5.0.0 - 5.1.1
Fatal error: Class 'SplFileInfo' not found in /in/jsDNX on line 3
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING in /in/jsDNX on line 7
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_STRING in /in/jsDNX on line 7
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/jsDNX on line 7
Process exited with code 255.