1--TEST-- 2IntlCalendar::equals(): bad arguments 3--INI-- 4date.timezone=Atlantic/Azores 5--SKIPIF-- 6<?php 7if (!extension_loaded('intl')) 8 die('skip intl extension not enabled'); 9--FILE-- 10<?php 11ini_set("intl.error_level", E_WARNING); 12 13$c = new IntlGregorianCalendar(NULL, 'pt_PT'); 14 15function eh($errno, $errstr) { 16echo "error: $errno, $errstr\n"; 17} 18set_error_handler('eh'); 19 20try { 21 var_dump($c->equals()); 22} catch (Error $ex) { 23 echo "error: " . $ex->getCode() . ", " . $ex->getMessage() . "\n\n"; 24} 25try { 26 var_dump($c->equals(new stdclass)); 27} catch (Error $ex) { 28 echo "error: " . $ex->getCode() . ", " . $ex->getMessage() . "\n\n"; 29} 30try { 31 var_dump($c->equals(1, 2)); 32} catch (Error $ex) { 33 echo "error: " . $ex->getCode() . ", " . $ex->getMessage() . "\n\n"; 34} 35 36 37try { 38 var_dump(intlcal_equals($c, array())); 39} catch (Error $ex) { 40 echo "error: " . $ex->getCode() . ", " . $ex->getMessage() . "\n\n"; 41} 42try { 43 var_dump(intlcal_equals(1, $c)); 44} catch (Error $ex) { 45 echo "error: " . $ex->getCode() . ", " . $ex->getMessage() . "\n\n"; 46} 47 48--EXPECT-- 49error: 2, IntlCalendar::equals() expects exactly 1 parameter, 0 given 50error: 2, IntlCalendar::equals(): intlcal_equals: bad arguments 51bool(false) 52error: 0, Argument 1 passed to IntlCalendar::equals() must be an instance of IntlCalendar, instance of stdClass given 53 54error: 0, Argument 1 passed to IntlCalendar::equals() must be an instance of IntlCalendar, integer given 55 56error: 0, Argument 2 passed to intlcal_equals() must be an instance of IntlCalendar, array given 57 58error: 0, Argument 1 passed to intlcal_equals() must be an instance of IntlCalendar, integer given 59