1--TEST--
2Test ord() function : basic functionality
3--FILE--
4<?php
5
6echo "*** Testing ord() : basic functionality ***\n";
7
8var_dump(ord("a"));
9var_dump(ord("z"));
10var_dump(ord("0"));
11var_dump(ord("9"));
12var_dump(ord("!"));
13var_dump(ord("*"));
14var_dump(ord("@"));
15var_dump(ord("\n"));
16var_dump(ord("\x0A"));
17var_dump(ord("\xFF"));
18var_dump(ord("Hello"));
19
20// Make sure all valid ascii chars round trip
21for ($i = 0; $i < 255; $i++) {
22    if (ord(chr($i)) != $i) {
23        exit("TEST FAILED: $i does not round trip\n");
24    }
25}
26
27?>
28--EXPECT--
29*** Testing ord() : basic functionality ***
30int(97)
31int(122)
32int(48)
33int(57)
34int(33)
35int(42)
36int(64)
37int(10)
38int(10)
39int(255)
40int(72)
41