3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test($obj) { $obj->fputcsv([]); } $objects = [ new SplFileObject(tempnam(sys_get_temp_dir(), 'tmp')), (new ReflectionClass( "SplFileObject" ))->newInstanceWithoutConstructor(), ]; foreach ($objects as $obj) { test($obj); }
Output for 8.4.1 - 8.4.14, 8.5.0
Deprecated: SplFileObject::fputcsv(): the $escape parameter must be provided, as its default value will change, either explicitly or via SplFileObject::setCsvControl() in /in/XMvIQ on line 4 Notice: SplFileObject::fputcsv(): Write of 1 bytes failed with errno=9 Bad file descriptor in /in/XMvIQ on line 4
Process exited with code 139.
Output for 8.4.15
/bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.35' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.34' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15)
Process exited with code 1.
Output for 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.1, 8.3.3 - 8.3.28
Notice: SplFileObject::fputcsv(): Write of 1 bytes failed with errno=9 Bad file descriptor in /in/XMvIQ on line 4
Process exited with code 139.
Output for 8.3.2
Fatal error: Uncaught RuntimeException: SplFileObject::__construct(/tmp/tmpPC3zQL): Failed to open stream: Permission denied in /in/XMvIQ:8 Stack trace: #0 /in/XMvIQ(8): SplFileObject->__construct('/tmp/tmpPC3zQL') #1 {main} thrown in /in/XMvIQ on line 8
Process exited with code 255.

preferences:
81.28 ms | 410 KiB | 5 Q