1--TEST-- 2Test ctype_punct() function : usage variations - Octal and Hexadecimal values 3--SKIPIF-- 4<?php require_once('skipif.inc'); ?> 5--FILE-- 6<?php 7/* Prototype : bool ctype_punct(mixed $c) 8 * Description: Checks for any printable character which is not whitespace 9 * or an alphanumeric character 10 * Source code: ext/ctype/ctype.c 11 */ 12 13/* 14 * Pass different octal and hexadecimal values to ctype_punct() to test behaviour 15 */ 16 17echo "*** Testing ctype_punct() : usage variations ***\n"; 18 19$orig = setlocale(LC_CTYPE, "C"); 20 21$octal_values = array(041, 042, 043, 044); 22$hex_values = array(0x21, 0x22, 0x23, 0x24); 23 24echo "\n-- Octal Values --\n"; 25$iterator = 1; 26foreach($octal_values as $c) { 27 echo "-- Iteration $iterator --\n"; 28 var_dump(ctype_punct($c)); 29 $iterator++; 30} 31 32echo "\n-- Hexadecimal Values --\n"; 33$iterator = 1; 34foreach($hex_values as $c) { 35 echo "-- Iteration $iterator --\n"; 36 var_dump(ctype_punct($c)); 37 $iterator++; 38} 39 40setlocale(LC_CTYPE, $orig); 41?> 42===DONE=== 43--EXPECTF-- 44*** Testing ctype_punct() : usage variations *** 45 46-- Octal Values -- 47-- Iteration 1 -- 48bool(true) 49-- Iteration 2 -- 50bool(true) 51-- Iteration 3 -- 52bool(true) 53-- Iteration 4 -- 54bool(true) 55 56-- Hexadecimal Values -- 57-- Iteration 1 -- 58bool(true) 59-- Iteration 2 -- 60bool(true) 61-- Iteration 3 -- 62bool(true) 63-- Iteration 4 -- 64bool(true) 65===DONE=== 66