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