1--TEST-- 2Test imagecolorclosesthwb() basic functionality 3--EXTENSIONS-- 4gd 5--FILE-- 6<?php 7 // Create the size of image or blank image 8 $image = imagecreate(500, 200); 9 10 // Set the background color of image 11 $background_color = imagecolorallocate($image, 0, 24, 200); 12 13 // Set the text color of image 14 $text_color = imagecolorallocate($image, 255, 255, 255); 15 16 // Function to create image which contains string. 17 imagestring($image, 5, 180, 100, "PHP is awesome", $text_color); 18 imagestring($image, 3, 120, 120, "A test for PHP imagecolorclosesthwb function", $text_color); 19 20 var_dump(imagecolorclosesthwb($image, 0, 115, 152)); // 0 21 var_dump(imagecolorclosesthwb($image, 0, 24, 200)); // 0 22 var_dump(imagecolorclosesthwb($image, 116, 120, 115)); // 1 23 var_dump(imagecolorclosesthwb($image, 50, 0, 90)); // 0 24 25 imagedestroy($image); 26?> 27--EXPECT-- 28int(0) 29int(0) 30int(1) 31int(0) 32