1--TEST-- 2IntlCalendar::isEquivalentTo(): 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->isEquivalentTo(0)); 22} catch (Error $ex) { 23 echo "error: " . $ex->getCode() . ", " . $ex->getMessage() . "\n\n"; 24} 25try { 26 var_dump($c->isEquivalentTo($c, 1)); 27} catch (Error $ex) { 28 echo "error: " . $ex->getCode() . ", " . $ex->getMessage() . "\n\n"; 29} 30try { 31 var_dump($c->isEquivalentTo(1)); 32} catch (Error $ex) { 33 echo "error: " . $ex->getCode() . ", " . $ex->getMessage() . "\n\n"; 34} 35 36try { 37 var_dump(intlcal_is_equivalent_to($c)); 38} catch (Error $ex) { 39 echo "error: " . $ex->getCode() . ", " . $ex->getMessage() . "\n\n"; 40} 41try { 42 var_dump(intlcal_is_equivalent_to($c, 1)); 43} catch (Error $ex) { 44 echo "error: " . $ex->getCode() . ", " . $ex->getMessage() . "\n\n"; 45} 46try { 47 var_dump(intlcal_is_equivalent_to(1, $c)); 48} catch (Error $ex) { 49 echo "error: " . $ex->getCode() . ", " . $ex->getMessage() . "\n\n"; 50} 51 52--EXPECT-- 53error: 0, Argument 1 passed to IntlCalendar::isEquivalentTo() must be an instance of IntlCalendar, integer given 54 55error: 2, IntlCalendar::isEquivalentTo() expects exactly 1 parameter, 2 given 56error: 2, IntlCalendar::isEquivalentTo(): intlcal_is_equivalent_to: bad arguments 57bool(false) 58error: 0, Argument 1 passed to IntlCalendar::isEquivalentTo() must be an instance of IntlCalendar, integer given 59 60error: 2, intlcal_is_equivalent_to() expects exactly 2 parameters, 1 given 61error: 2, intlcal_is_equivalent_to(): intlcal_is_equivalent_to: bad arguments 62bool(false) 63error: 0, Argument 2 passed to intlcal_is_equivalent_to() must be an instance of IntlCalendar, integer given 64 65error: 0, Argument 1 passed to intlcal_is_equivalent_to() must be an instance of IntlCalendar, integer given 66