1--TEST-- 2Test wrong number of arguments and wrong arg types for ob_start() 3--FILE-- 4<?php 5/* 6 * proto bool ob_start([ string|array user_function [, int chunk_size [, bool erase]]]) 7 * Function is implemented in main/output.c 8*/ 9 10function justPrint($str) { 11 return $str; 12} 13 14$arg_1 = "justPrint"; 15$arg_2 = 0; 16$arg_3 = false; 17$extra_arg = 1; 18 19echo "\n- Too many arguments\n"; 20var_dump(ob_start($arg_1, $arg_2, $arg_3, $extra_arg)); 21 22echo "\n- Arg 1 wrong type\n"; 23var_dump(ob_start(1.5)); 24 25echo "\n- Arg 2 wrong type\n"; 26var_dump(ob_start("justPrint", "this should be an int")); 27 28echo "\n- Arg 3 wrong type\n"; 29var_dump(ob_start("justPrint", 0, "this should be a bool")); 30 31?> 32--EXPECTF-- 33- Too many arguments 34 35Warning: ob_start() expects at most 3 parameters, 4 given in %s on line 17 36NULL 37 38- Arg 1 wrong type 39 40Warning: ob_start(): no array or string given in %s on line 20 41 42Notice: ob_start(): failed to create buffer in %s on line 20 43bool(false) 44 45- Arg 2 wrong type 46 47Warning: ob_start() expects parameter 2 to be integer, string given in %s on line 23 48NULL 49 50- Arg 3 wrong type 51 52Warning: ob_start() expects parameter 3 to be integer, string given in %s on line 26 53NULL 54