HEX
Server: nginx/1.24.0
System: Linux localhost 5.15.0-46-generic #49-Ubuntu SMP Thu Aug 4 18:03:25 UTC 2022 x86_64
User: www (1000)
PHP: 8.3.27
Disabled: passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Upload Files
File: /www/server/php/83/src/ext/spl/tests/SplFileinfo_debugInfo_basic.phpt
--TEST--
SPL: SplFileInfo::_debugInfo() basic test
--FILE--
<?php
// without $suffix
var_dump(new \SplFileInfo('/path/to/a.txt'));
var_dump(new \SplFileInfo('path/to/b'));
var_dump(new \SplFileInfo('c.txt'));
var_dump(new \SplFileInfo('d'));
var_dump(new \SplFileInfo('~/path/to//e'));

// with $suffix
var_dump(new \SplFileInfo('path/to/a.txt'));
var_dump(new \SplFileInfo('path/to/bbb.txt'));
var_dump(new \SplFileInfo('path/to/ccc.txt'));
var_dump(new \SplFileInfo('d.txt'));
var_dump(new \SplFileInfo('e.txt'));
var_dump(new \SplFileInfo('f'));
?>
--EXPECT--
object(SplFileInfo)#1 (2) {
  ["pathName":"SplFileInfo":private]=>
  string(14) "/path/to/a.txt"
  ["fileName":"SplFileInfo":private]=>
  string(5) "a.txt"
}
object(SplFileInfo)#1 (2) {
  ["pathName":"SplFileInfo":private]=>
  string(9) "path/to/b"
  ["fileName":"SplFileInfo":private]=>
  string(1) "b"
}
object(SplFileInfo)#1 (2) {
  ["pathName":"SplFileInfo":private]=>
  string(5) "c.txt"
  ["fileName":"SplFileInfo":private]=>
  string(5) "c.txt"
}
object(SplFileInfo)#1 (2) {
  ["pathName":"SplFileInfo":private]=>
  string(1) "d"
  ["fileName":"SplFileInfo":private]=>
  string(1) "d"
}
object(SplFileInfo)#1 (2) {
  ["pathName":"SplFileInfo":private]=>
  string(12) "~/path/to//e"
  ["fileName":"SplFileInfo":private]=>
  string(1) "e"
}
object(SplFileInfo)#1 (2) {
  ["pathName":"SplFileInfo":private]=>
  string(13) "path/to/a.txt"
  ["fileName":"SplFileInfo":private]=>
  string(5) "a.txt"
}
object(SplFileInfo)#1 (2) {
  ["pathName":"SplFileInfo":private]=>
  string(15) "path/to/bbb.txt"
  ["fileName":"SplFileInfo":private]=>
  string(7) "bbb.txt"
}
object(SplFileInfo)#1 (2) {
  ["pathName":"SplFileInfo":private]=>
  string(15) "path/to/ccc.txt"
  ["fileName":"SplFileInfo":private]=>
  string(7) "ccc.txt"
}
object(SplFileInfo)#1 (2) {
  ["pathName":"SplFileInfo":private]=>
  string(5) "d.txt"
  ["fileName":"SplFileInfo":private]=>
  string(5) "d.txt"
}
object(SplFileInfo)#1 (2) {
  ["pathName":"SplFileInfo":private]=>
  string(5) "e.txt"
  ["fileName":"SplFileInfo":private]=>
  string(5) "e.txt"
}
object(SplFileInfo)#1 (2) {
  ["pathName":"SplFileInfo":private]=>
  string(1) "f"
  ["fileName":"SplFileInfo":private]=>
  string(1) "f"
}