- var_dump: documentation ( source)
- touch: documentation ( source)
- realpath: documentation ( source)
- array_unique: documentation ( source)
<?php
// Error!
class Test
{
public function foo()
{
$file = '/tmp/bar';
touch($file);
$files = [
realpath($file)
];
var_dump($files);
var_dump(array_unique($files));
return array_unique($files);
}
}
var_dump((new Test())->foo());