1--TEST-- 2Test token_get_all() function : error conditions 3--SKIPIF-- 4<?php if (!extension_loaded("tokenizer")) print "skip"; ?> 5--FILE-- 6<?php 7/* Prototype : array token_get_all(string $source) 8 * Description: splits the given source into an array of PHP languange tokens 9 * Source code: ext/tokenizer/tokenizer.c 10*/ 11 12echo "*** Testing token_get_all() : error conditions ***\n"; 13 14// with zero arguments 15echo "\n-- Testing token_get_all() function with zero arguments --\n"; 16var_dump( token_get_all()); 17 18// with one more than the expected number of arguments 19echo "-- Testing token_get_all() function with more than expected no. of arguments --\n"; 20$source = '<?php ?>'; 21$extra_arg = 10; 22var_dump( token_get_all($source, true, $extra_arg)); 23 24echo "Done" 25?> 26--EXPECTF-- 27*** Testing token_get_all() : error conditions *** 28 29-- Testing token_get_all() function with zero arguments -- 30 31Warning: token_get_all() expects at least 1 parameter, 0 given in %s on line 11 32NULL 33-- Testing token_get_all() function with more than expected no. of arguments -- 34 35Warning: token_get_all() expects at most 2 parameters, 3 given in %s on line 17 36NULL 37Done