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?> 13--FILE-- 14<?php 15$img = imagecreatetruecolor(150, 150); 16 17$cor = imagecolorallocate($img, 50, 100, 255); 18$corA = imagecolorallocatealpha($img, 50, 100, 255, 50); 19//$whiteA = imagecolorallocatealpha($img, 255, 255, 255, 127); 20 21$half = imagefilledarc ( $img, 75, 75, 70, 70, 0, 180, $cor, IMG_ARC_PIE ); 22$half2 = imagefilledarc ( $img, 75, 75, 70, 70, 180, 360, $corA, IMG_ARC_PIE ); 23 24include_once __DIR__ . '/func.inc'; 25test_image_equals_file(__DIR__ . '/imagecolorallocatealpha_basic.png', $img); 26var_dump($corA); 27?> 28--EXPECT-- 29The images are equal. 30int(842163455) 31