<?php
class Foo
{
public $fileHandles = [];
public $files = [];
public function baz()
{
$offset = 15;
$this->files[$offset] = tempnam();
if (false === $file || false === $this->fileHandles[$offset] = fopen($this->files[$offset], 'rb')) {
throw new RuntimeException('A temporary file could not be opened to write the process output to, verify that your TEMP environment variable is writable');
}
}
}
$foo = new Foo;
$foo->baz();
function set($param)
{
if ($param > 10) {
return $param;
}
return false;
}
Fatal error: Uncaught ArgumentCountError: tempnam() expects exactly 2 arguments, 0 given in /in/fdZtr:12
Stack trace:
#0 /in/fdZtr(12): tempnam()
#1 /in/fdZtr(21): Foo->baz()
#2 {main}
thrown in /in/fdZtr on line 12
Process exited with code 255.
Warning: tempnam() expects exactly 2 parameters, 0 given in /in/fdZtr on line 12
Notice: Undefined variable: file in /in/fdZtr on line 14
Warning: fopen(): Filename cannot be empty in /in/fdZtr on line 14
Fatal error: Uncaught RuntimeException: A temporary file could not be opened to write the process output to, verify that your TEMP environment variable is writable in /in/fdZtr:15
Stack trace:
#0 /in/fdZtr(21): Foo->baz()
#1 {main}
thrown in /in/fdZtr on line 15
Process exited with code 255.
Output for 7.3.32 - 7.3.33
Warning: tempnam() expects exactly 2 parameters, 0 given in /in/fdZtr on line 12
Warning: fopen(): Filename cannot be empty in /in/fdZtr on line 14
Fatal error: Uncaught RuntimeException: A temporary file could not be opened to write the process output to, verify that your TEMP environment variable is writable in /in/fdZtr:15
Stack trace:
#0 /in/fdZtr(21): Foo->baz()
#1 {main}
thrown in /in/fdZtr on line 15
Process exited with code 255.
Warning: tempnam() expects exactly 2 parameters, 0 given in /in/fdZtr on line 12
Notice: Undefined variable: file in /in/fdZtr on line 14
Warning: fopen(): Filename cannot be empty in /in/fdZtr on line 14
Fatal error: Uncaught exception 'RuntimeException' with message 'A temporary file could not be opened to write the process output to, verify that your TEMP environment variable is writable' in /in/fdZtr:15
Stack trace:
#0 /in/fdZtr(21): Foo->baz()
#1 {main}
thrown in /in/fdZtr on line 15
Process exited with code 255.