1--TEST-- 2Testing imagecolorallocatealpha() 3--CREDITS-- 4Rafael Dohms <rdohms [at] gmail [dot] com> 5--EXTENSIONS-- 6gd 7--SKIPIF-- 8<?php 9 if (!GD_BUNDLED && version_compare(GD_VERSION, '2.2.2', '<')) { 10 die("skip test requires GD 2.2.2 or higher"); 11 } 12 if (!(imagetypes() & IMG_PNG)) { 13 die("skip No PNG support"); 14 } 15?> 16--FILE-- 17<?php 18$img = imagecreatetruecolor(150, 150); 19 20$cor = imagecolorallocate($img, 50, 100, 255); 21$corA = imagecolorallocatealpha($img, 50, 100, 255, 50); 22//$whiteA = imagecolorallocatealpha($img, 255, 255, 255, 127); 23 24$half = imagefilledarc ( $img, 75, 75, 70, 70, 0, 180, $cor, IMG_ARC_PIE ); 25$half2 = imagefilledarc ( $img, 75, 75, 70, 70, 180, 360, $corA, IMG_ARC_PIE ); 26 27include_once __DIR__ . '/func.inc'; 28test_image_equals_file(__DIR__ . '/imagecolorallocatealpha_basic.png', $img); 29var_dump($corA); 30?> 31--EXPECT-- 32The images are equal. 33int(842163455) 34