1--TEST--
2Basic long path test
3--SKIPIF--
4<?php
5include __DIR__ . DIRECTORY_SEPARATOR . "util.inc";
6
7skip_if_not_win();
8if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
9skip_if_no_required_exts("mbstring");
10
11?>
12--FILE--
13<?php
14
15$p = "";
16$s = str_repeat('a', 50);
17$how_many = 32;
18
19for ($i = 0; $i < $how_many; $i++) {
20    $p .= "$s";
21    $p .= DIRECTORY_SEPARATOR;
22}
23
24$p = realpath(__DIR__) . DIRECTORY_SEPARATOR . $p;
25
26echo strlen($p), "\n", $p, "\n";
27
28
29var_dump(mkdir($p, 0777, true));
30var_dump(file_exists($p));
31
32for ($i = 0; $i < $how_many; $i++) {
33    $p0 = substr($p, 0, strlen($p) - $i*51);
34    rmdir($p0);
35}
36
37var_dump(file_exists(realpath(__DIR__) . DIRECTORY_SEPARATOR . $s));
38
39?>
40--EXPECTF--
41%d%d%d%d
42%s\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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