1--TEST-- 2Test preg_grep() function : error conditions - wrong numbers of parameters 3--FILE-- 4<?php 5 6/* Prototype : int preg_last_error ( void ) 7 * Description: Returns the error code of the last PCRE regex execution 8 * Source code: ext/pcre/php_pcre.c 9 */ 10 11/* 12 * Pass an incorrect number of arguments to preg_last_error() to test behaviour 13 */ 14 15echo "*** Testing preg_last_error() : error conditions ***\n"; 16 17// Test preg_last_error with one more than the expected number of arguments 18echo "\n-- Testing preg_last_error() function with more than expected no. of arguments --\n"; 19$extra_arg = 10; 20var_dump( preg_last_error($extra_arg) ); 21?> 22===Done=== 23--EXPECTF-- 24*** Testing preg_last_error() : error conditions *** 25 26-- Testing preg_last_error() function with more than expected no. of arguments -- 27 28Warning: preg_last_error() expects exactly 0 parameters, 1 given in %s on line %d 29NULL 30===Done===