bug67248.phpt 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. --TEST--
  2. Bug #67248 (imageaffinematrixget missing check of parameters)
  3. --EXTENSIONS--
  4. gd
  5. --SKIPIF--
  6. <?php
  7. if(!function_exists('imageaffinematrixget')) die('skip imageaffinematrixget() not available');
  8. ?>
  9. --FILE--
  10. <?php
  11. require __DIR__ . '/func.inc';
  12. for($i=0;$i<7;$i++) {
  13. trycatch_dump(
  14. fn() => imageaffinematrixget($i, new stdClass())
  15. );
  16. }
  17. ?>
  18. --EXPECTF--
  19. !! [TypeError] imageaffinematrixget(): Argument #1 ($type) must be of type array when using translate or scale
  20. !! [TypeError] imageaffinematrixget(): Argument #1 ($type) must be of type array when using translate or scale
  21. Warning: Object of class stdClass could not be converted to float in %s on line %d
  22. array(6) {
  23. [0]=>
  24. float(%f)
  25. [1]=>
  26. float(%f)
  27. [2]=>
  28. float(%f)
  29. [3]=>
  30. float(%f)
  31. [4]=>
  32. float(0)
  33. [5]=>
  34. float(0)
  35. }
  36. Warning: Object of class stdClass could not be converted to float in %s on line %d
  37. array(6) {
  38. [0]=>
  39. float(1)
  40. [1]=>
  41. float(0)
  42. [2]=>
  43. float(%f)
  44. [3]=>
  45. float(1)
  46. [4]=>
  47. float(0)
  48. [5]=>
  49. float(0)
  50. }
  51. Warning: Object of class stdClass could not be converted to float in %s on line %d
  52. array(6) {
  53. [0]=>
  54. float(1)
  55. [1]=>
  56. float(%f)
  57. [2]=>
  58. float(0)
  59. [3]=>
  60. float(1)
  61. [4]=>
  62. float(0)
  63. [5]=>
  64. float(0)
  65. }
  66. !! [ValueError] imageaffinematrixget(): Argument #1 ($type) must be a valid element type
  67. !! [ValueError] imageaffinematrixget(): Argument #1 ($type) must be a valid element type