diff options
Diffstat (limited to 'ext/standard/tests/general_functions')
23 files changed, 0 insertions, 714 deletions
diff --git a/ext/standard/tests/general_functions/001.phpt b/ext/standard/tests/general_functions/001.phpt deleted file mode 100644 index 164bd7fb21..0000000000 --- a/ext/standard/tests/general_functions/001.phpt +++ /dev/null @@ -1,67 +0,0 @@ ---TEST-- -sprintf() function ---FILE-- -<?php - -$agent = sprintf("%.5s", "James Bond, 007"); - -echo("sprintf string truncate test: "); -if ($agent == "James") { - echo("passed\n"); -} else { - echo("failed!\n"); -} - -echo("sprintf padding and align test: "); -$test = sprintf("abc%04d %-20s%c", 20, "fisketur", 33); -if ($test == "abc0020 fisketur !") { - echo("passed\n"); -} else { - echo("failed!\n"); -} - -echo("sprintf octal and hex test: "); -$test = sprintf("%4o %4x %4X %0"."8x", 128, 1024, 49151, 3457925); -if ($test == " 200 400 BFFF 0034c385") { - echo("passed\n"); -} else { - echo("failed!\n"); -} - -echo("sprintf octal binary test: "); -$test = sprintf("%b", 3457925); -if ($test == "1101001100001110000101") { - echo("passed\n"); -} else { - echo("failed!\n"); -} - -echo("sprintf float test: "); -$test = sprintf("%0"."06.2f", 10000/3.0); -if ($test == "003333.33") { - echo("passed\n"); -} else { - echo("failed!\n"); -} - -echo sprintf("%.2f\n", "99.00"); -echo sprintf("%.2f\n", 99.00); - -echo sprintf("%e\n", 1.234E-18); -echo sprintf("%e\n", 1.234E+18); -echo sprintf("%e\n", 9843243.12); -echo sprintf("%e\n", -9843243.12); - -?> ---EXPECT-- -sprintf string truncate test: passed -sprintf padding and align test: passed -sprintf octal and hex test: passed -sprintf octal binary test: passed -sprintf float test: passed -99.00 -99.00 -1.23400e-18 -1.23400e+18 -9.84324e+6 --9.84324e+6 diff --git a/ext/standard/tests/general_functions/002.phpt b/ext/standard/tests/general_functions/002.phpt deleted file mode 100644 index 58528da13a..0000000000 --- a/ext/standard/tests/general_functions/002.phpt +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -quoted_printable_decode() function test ---FILE-- -<?php echo quoted_printable_decode("=FAwow-factor=C1=d0=D5=DD=C5=CE=CE=D9=C5=0A= -=20=D4=cf=D2=C7=CF=D7=D9=C5= -=20= -=D0= -=D2=CF=C5=CB=D4=D9"); ?> ---EXPECT-- -úwow-factorÁÐÕÝÅÎÎÙÅ - ÔÏÒÇÏ×ÙÅ ÐÒÏÅËÔÙ diff --git a/ext/standard/tests/general_functions/003.phpt b/ext/standard/tests/general_functions/003.phpt deleted file mode 100644 index 7ad90c8b5a..0000000000 --- a/ext/standard/tests/general_functions/003.phpt +++ /dev/null @@ -1,58 +0,0 @@ ---TEST-- -levenshtein() function test ---FILE-- -<?php - -function test_me($title,$expect,$text1,$text2,$cost1=0,$cost2=0,$cost3=0) { - - if($cost1==0) - $result=levenshtein($text1,$text2); - else - $result=levenshtein($text1,$text2,$cost1,$cost2,$cost3); - - if($result==$expect) return 0; - - echo "$title: result is $result instead of $expect "; - echo "for '$text1'/'$text2' "; - if($cost1) echo "($cost1:$cost2:$cost3)"; - echo "\n"; - - return 1; -} - -$n=0; - -$n += test_me("equal" , 0, "12345", "12345"); -$n += test_me("1st empty" , 3, "", "xzy"); -$n += test_me("2nd empty" , 3, "xzy", ""); -$n += test_me("both empty" , 0, "", ""); -$n += test_me("1 char" , 1, "1", "2"); -$n += test_me("2 char swap", 2, "12", "21"); - -$n += test_me("inexpensive delete", 2, "2121", "11", 2, 1, 1); -$n += test_me("expensive delete" , 10, "2121", "11", 2, 1, 5); -$n += test_me("inexpensive insert", 2, "11", "2121", 1, 1, 1); -$n += test_me("expensive insert" , 10, "11", "2121", 5, 1, 1); - -$n += test_me("expensive replace" , 3, "111", "121", 2, 3, 2); -$n += test_me("very expensive replace", 4, "111", "121", 2, 9, 2); - -$n += test_me("bug #7368", 2, "13458", "12345"); -$n += test_me("bug #7368", 2, "1345", "1234"); - -$n += test_me("bug #6562", 1, "debugg", "debug"); -$n += test_me("bug #6562", 1, "ddebug", "debug"); -$n += test_me("bug #6562", 2, "debbbug", "debug"); -$n += test_me("bug #6562", 1, "debugging", "debuging"); - -$n += test_me("bug #16473", 2, "a", "bc"); -$n += test_me("bug #16473", 2, "xa", "xbc"); -$n += test_me("bug #16473", 2, "xax", "xbcx"); -$n += test_me("bug #16473", 2, "ax", "bcx"); - - -echo ($n==0)?"all passed\n":"$n failed\n"; - -?> ---EXPECT-- -all passed diff --git a/ext/standard/tests/general_functions/004.data b/ext/standard/tests/general_functions/004.data deleted file mode 100644 index 5dd0832842..0000000000 --- a/ext/standard/tests/general_functions/004.data +++ /dev/null @@ -1,4 +0,0 @@ -name value comment -true 1 boolean true -false 0 boolean false -empty nothing diff --git a/ext/standard/tests/general_functions/004.phpt b/ext/standard/tests/general_functions/004.phpt deleted file mode 100644 index 40b47cc1ca..0000000000 --- a/ext/standard/tests/general_functions/004.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -fgetcsv() with tab delimited fields (BUG #8258) ---FILE-- -<?php -chdir(dirname(__FILE__)); -$fp=fopen("004.data","r"); -while($a=fgetcsv($fp,100,"\t")) { - echo join(",",$a)."\n"; -} -fclose($fp); -?> ---EXPECT-- -name,value,comment -true,1,boolean true -false,0,boolean false -empty,,nothing diff --git a/ext/standard/tests/general_functions/005.phpt b/ext/standard/tests/general_functions/005.phpt deleted file mode 100644 index 027d124add..0000000000 --- a/ext/standard/tests/general_functions/005.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -is_scalar() function test ---FILE-- -<?php -class foo {} -var_dump (is_scalar (TRUE)); -var_dump (is_scalar (1)); -var_dump (is_scalar (1.0)); -var_dump (is_scalar ("Hi!")); -var_dump (is_scalar (NULL)); -var_dump (is_scalar (array ())); -var_dump (is_scalar (new foo())); -var_dump (is_scalar (opendir('.'))); -?> ---EXPECT-- -bool(true) -bool(true) -bool(true) -bool(true) -bool(false) -bool(false) -bool(false) -bool(false) - diff --git a/ext/standard/tests/general_functions/006.phpt b/ext/standard/tests/general_functions/006.phpt deleted file mode 100644 index 6852286c5e..0000000000 --- a/ext/standard/tests/general_functions/006.phpt +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -quoted_printable_decode() function test with CR/LF ---FILE-- -<?php echo quoted_printable_decode("=FAwow-factor=C1=D0=D5=DD=C5=CE=CE=D9=C5=0A= -=20=D4=CF=D2=C7=CF=D7=D9=C5= -=20= -=D0= -=D2=CF=C5=CB=D4=D9"); ?> ---EXPECT-- -úwow-factorÁÐÕÝÅÎÎÙÅ - ÔÏÒÇÏ×ÙÅ ÐÒÏÅËÔÙ diff --git a/ext/standard/tests/general_functions/007.phpt b/ext/standard/tests/general_functions/007.phpt deleted file mode 100644 index f755ab4f80..0000000000 --- a/ext/standard/tests/general_functions/007.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -MD5 / Base64 ---FILE-- -<?php -function test($str) { - $res = md5(base64_decode(base64_encode($str)))."\n"; - return $res; -} -echo test(""); -echo test("a"); -echo test("abc"); -echo test("message digest"); -echo test("abcdefghijklmnopqrstuvwxyz"); -echo test("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"); -echo test("12345678901234567890123456789012345678901234567890123456789012345678901234567890"); -?> ---EXPECT-- -d41d8cd98f00b204e9800998ecf8427e -0cc175b9c0f1b6a831c399e269772661 -900150983cd24fb0d6963f7d28e17f72 -f96b697d7cb7938d525a2f31aaf161d0 -c3fcd3d76192e4007dfb496cca67e13b -d174ab98d277d9f5a5611c2c9f419d9f -57edf4a22be3c955ac49da2e2107b67a diff --git a/ext/standard/tests/general_functions/008.phpt b/ext/standard/tests/general_functions/008.phpt deleted file mode 100644 index bb633c334d..0000000000 --- a/ext/standard/tests/general_functions/008.phpt +++ /dev/null @@ -1,40 +0,0 @@ ---TEST-- -var_dump float test ---INI-- -precision=12 ---FILE-- -<?php -// this checks f,g,G conversion for snprintf/spprintf -var_dump(array(ini_get('precision'),.012,-.012,.12,-.12,1.2,-1.2,12.,-12.,0.000123,.0000123,123456789012.0,1234567890123.0,12345678901234567890.0)); -?> ---EXPECT-- -array(14) { - [0]=> - string(2) "12" - [1]=> - float(0.012) - [2]=> - float(-0.012) - [3]=> - float(0.12) - [4]=> - float(-0.12) - [5]=> - float(1.2) - [6]=> - float(-1.2) - [7]=> - float(12) - [8]=> - float(-12) - [9]=> - float(0.000123) - [10]=> - float(1.23E-5) - [11]=> - float(123456789012) - [12]=> - float(1234567890120) - [13]=> - float(1.23456789012E+19) -}
\ No newline at end of file diff --git a/ext/standard/tests/general_functions/009.phpt b/ext/standard/tests/general_functions/009.phpt deleted file mode 100644 index e80d36140d..0000000000 --- a/ext/standard/tests/general_functions/009.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -SHA1 ---FILE-- -<?php -function test($str) { - $res = sha1($str)."\n"; - return $res; -} -echo test(""); -echo test("a"); -echo test("abc"); -echo test("message digest"); -echo test("abcdefghijklmnopqrstuvwxyz"); -echo test("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"); -echo test("12345678901234567890123456789012345678901234567890123456789012345678901234567890"); -?> ---EXPECT-- -da39a3ee5e6b4b0d3255bfef95601890afd80709 -86f7e437faa5a7fce15d1ddcb9eaeaea377667b8 -a9993e364706816aba3e25717850c26c9cd0d89d -c12252ceda8be8994d5fa0290a47231c1d16aae3 -32d10c7b8cf96570ca04ce37f2a19d84240d3a89 -761c457bf73b14d27e9e9265c46f4b4dda11f940 -50abf5706a150990a08b2c5ea40fa0e585554732 diff --git a/ext/standard/tests/general_functions/010.phpt b/ext/standard/tests/general_functions/010.phpt deleted file mode 100644 index 8d1075f842..0000000000 --- a/ext/standard/tests/general_functions/010.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -register_shutdown_function() & __call ---FILE-- -<?php -class test { - function _foo() { - throw new Exception('test'); - } - function __call($name=null, $args=null) { - return test::_foo(); - } -} - -var_dump(register_shutdown_function(array("test","__call"))); - -echo "Done\n"; -?> ---EXPECTF-- -Strict Standards: Non-static method test::__call() cannot be called statically in %s on line %d -NULL -Done - -Strict Standards: Non-static method test::__call() cannot be called statically in Unknown on line 0 - -Fatal error: Non-static method test::__call() cannot be called statically in Unknown on line 0 diff --git a/ext/standard/tests/general_functions/bug25038.phpt b/ext/standard/tests/general_functions/bug25038.phpt deleted file mode 100755 index 52fe032056..0000000000 --- a/ext/standard/tests/general_functions/bug25038.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -Bug #25038 (call_user_func issues warning if function throws exception) ---FILE-- -<?php - -function bar($x='no argument') -{ - throw new Exception("This is an exception from bar({$x})."); -} -try -{ - bar('first try'); -} -catch (Exception $e) -{ - print $e->getMessage()."\n"; -} -try -{ - call_user_func('bar','second try'); -} -catch (Exception $e) -{ - print $e->getMessage()."\n"; -} - -?> -===DONE=== ---EXPECT-- -This is an exception from bar(first try). -This is an exception from bar(second try). -===DONE=== diff --git a/ext/standard/tests/general_functions/bug27678.phpt b/ext/standard/tests/general_functions/bug27678.phpt deleted file mode 100644 index ec9cf93cf7..0000000000 --- a/ext/standard/tests/general_functions/bug27678.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -bug #27678 (number_format() crashes with large numbers) ---FILE-- -<?php - -number_format(1e80, 0, '', ' '); -number_format(1e300, 0, '', ' '); -number_format(1e320, 0, '', ' '); -number_format(1e1000, 0, '', ' '); - -echo "Done\n"; -?> ---EXPECT-- -Done diff --git a/ext/standard/tests/general_functions/bug29038.phpt b/ext/standard/tests/general_functions/bug29038.phpt deleted file mode 100644 index 0f79229994..0000000000 --- a/ext/standard/tests/general_functions/bug29038.phpt +++ /dev/null @@ -1,74 +0,0 @@ ---TEST-- -Bug #29038 (extract(), EXTR_PREFIX_SAME option prefixes empty strings) ---FILE-- -<?php -function f1() { - $c = extract(array("" => 1),EXTR_PREFIX_SAME,"prefix"); - echo "Extracted:"; - var_dump($c); - print_r(get_defined_vars()); -} -function f2() { - $a = 1; - $c = extract(array("a" => 1),EXTR_PREFIX_SAME,"prefix"); - echo "Extracted:"; - var_dump($c); - print_r(get_defined_vars()); -} -function f3() { - $a = 1; - $c = extract(array("a" => 1),EXTR_PREFIX_ALL,"prefix"); - echo "Extracted:"; - var_dump($c); - print_r(get_defined_vars()); -} -function f4() { - $c = extract(array("" => 1),EXTR_PREFIX_ALL,"prefix"); - echo "Extracted:"; - var_dump($c); - print_r(get_defined_vars()); -} -function f5() { - $c = extract(array("111" => 1),EXTR_PREFIX_ALL,"prefix"); - echo "Extracted:"; - var_dump($c); - print_r(get_defined_vars()); -} - -f1(); -f2(); -f3(); -f4(); -f5(); -?> ---EXPECT-- -Extracted:int(0) -Array -( - [c] => 0 -) -Extracted:int(1) -Array -( - [a] => 1 - [prefix_a] => 1 - [c] => 1 -) -Extracted:int(1) -Array -( - [a] => 1 - [prefix_a] => 1 - [c] => 1 -) -Extracted:int(0) -Array -( - [c] => 0 -) -Extracted:int(1) -Array -( - [prefix_111] => 1 - [c] => 1 -) diff --git a/ext/standard/tests/general_functions/bug31190.phpt b/ext/standard/tests/general_functions/bug31190.phpt deleted file mode 100644 index 7d154708fa..0000000000 --- a/ext/standard/tests/general_functions/bug31190.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -Bug #31190 (exception in call_user_func_array()) ---FILE-- -<?php - -class test { - function throwException() { throw new Exception("Hello World!\n"); -} } - -$array = array(new test(), 'throwException'); -try { - call_user_func($array, 1, 2); -} catch (Exception $e) { - echo $e->getMessage(); -} - -try { - call_user_func_array($array, array(1, 2)); -} catch (Exception $e) { - echo $e->getMessage(); -} -?> ---EXPECT-- -Hello World! -Hello World! - diff --git a/ext/standard/tests/general_functions/bug32647.phpt b/ext/standard/tests/general_functions/bug32647.phpt deleted file mode 100644 index 2e82012077..0000000000 --- a/ext/standard/tests/general_functions/bug32647.phpt +++ /dev/null @@ -1,57 +0,0 @@ ---TEST-- -Bug #32647 (Using register_shutdown_function() with invalid callback can crash PHP) ---INI-- -error_reporting=4095 -display_errors=1 ---FILE-- -<?php - -function foo() -{ - echo "foo!\n"; -} - -class bar -{ - function barfoo () - { echo "bar!\n"; } -} - -unset($obj); -register_shutdown_function(array($obj,"")); // Invalid -register_shutdown_function(array($obj,"some string")); // Invalid -register_shutdown_function(array(0,"")); // Invalid -register_shutdown_function(array('bar','foo')); // Invalid -register_shutdown_function(array(0,"some string")); // Invalid -register_shutdown_function('bar'); // Invalid -register_shutdown_function('foo'); // Valid -register_shutdown_function(array('bar','barfoo')); // Invalid - -$obj = new bar; -register_shutdown_function(array($obj,'foobar')); // Invalid -register_shutdown_function(array($obj,'barfoo')); // Valid - -?> ---EXPECTF-- -Notice: Undefined variable: obj in %s on line %d - -Warning: register_shutdown_function(): Invalid shutdown callback 'Array' passed in %s on line %d - -Notice: Undefined variable: obj in %s on line %d - -Warning: register_shutdown_function(): Invalid shutdown callback 'Array' passed in %s on line %d - -Warning: register_shutdown_function(): Invalid shutdown callback 'Array' passed in %s on line %d - -Warning: register_shutdown_function(): Invalid shutdown callback 'Array' passed in %s on line %d - -Strict Standards: Non-static method bar::barfoo() cannot be called statically in %sbug32647.php on line %d - -Warning: register_shutdown_function(): Invalid shutdown callback 'bar::foobar' passed in %sbug32647.php on line %d -foo! - -Strict Standards: Non-static method bar::barfoo() cannot be called statically in Unknown on line 0 - -Strict Standards: Non-static method bar::barfoo() cannot be called statically in Unknown on line 0 -bar! -bar! diff --git a/ext/standard/tests/general_functions/bug35229.phpt b/ext/standard/tests/general_functions/bug35229.phpt deleted file mode 100755 index c3c273dfee..0000000000 --- a/ext/standard/tests/general_functions/bug35229.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -Bug #35229 (call_user_func() crashes when argument stack is nearly full) ---FILE-- -<?php -class test2 { - static function use_stack() { - echo "OK\n"; - } -} - -function __autoload($class) -{ - eval('class test1 extends test2 {}'); - - test1::use_stack( - 1,2,3,4,5,6,7,8,9,10, - 11,12,13,14,15,16,17,18,19,20, - 21,22,23,24,25,26,27,28,29,30 - ); -} - -call_user_func(array('test1', 'use_stack'), - 1,2,3,4,5,6,7,8,9,10, - 11,12,13,14,15,16,17,18,19,20, - 21,22,23,24,25,26,27,28,29,30 -); -?> ---EXPECT-- -OK -OK diff --git a/ext/standard/tests/general_functions/bug36011.phpt b/ext/standard/tests/general_functions/bug36011.phpt deleted file mode 100755 index 08a45014f2..0000000000 --- a/ext/standard/tests/general_functions/bug36011.phpt +++ /dev/null @@ -1,46 +0,0 @@ ---TEST-- -Bug #36011 (Strict errormsg wrong for call_user_func() and the likes) ---FILE-- -<?php - -class TestClass -{ - static function test() - { - echo __METHOD__ . "()\n"; - } - - function whee() - { - array_map(array('TestClass', 'test'), array('array_value')); - } - - function whee4() - { - call_user_func(array('TestClass', 'test')); - } - - static function whee5() - { - call_user_func(array('TestClass', 'test')); - } -} - -TestClass::test(); - -$a = new TestClass(); -$a->whee(); -$a->whee4(); -$a->whee5(); - -TestClass::whee5(); - -?> -===DONE=== ---EXPECTF-- -TestClass::test() -TestClass::test() -TestClass::test() -TestClass::test() -TestClass::test() -===DONE=== diff --git a/ext/standard/tests/general_functions/getopt.phpt b/ext/standard/tests/general_functions/getopt.phpt deleted file mode 100644 index e861268459..0000000000 --- a/ext/standard/tests/general_functions/getopt.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -getopt ---ARGS-- --v -h -d test -m 1234 -t -j ---INI-- -register_argc_argv=On -variables_order=GPS ---SKIPIF-- -<?php - if (substr(PHP_OS, 0, 3) == 'WIN') { - die('skip getopt() is currently not available on Windows'); - } -?> ---FILE-- -<?php - var_dump(getopt("d:m:j:vht")); -?> ---EXPECT-- -array(5) { - ["v"]=> - bool(false) - ["h"]=> - bool(false) - ["d"]=> - string(4) "test" - ["m"]=> - string(4) "1234" - ["t"]=> - bool(false) -} diff --git a/ext/standard/tests/general_functions/highlight_heredoc.phpt b/ext/standard/tests/general_functions/highlight_heredoc.phpt deleted file mode 100644 index 58f83806a5..0000000000 --- a/ext/standard/tests/general_functions/highlight_heredoc.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -highlight_string() handling of heredoc ---FILE-- -<?php -$str = ' -$x=<<<DD -jhdsjkfhjdsh -DD -.""; -$a=<<<DDDD -jhdsjkfhjdsh -DDDD; -'; -highlight_string($str); -?> ---EXPECT-- -<code><span style="color: #000000"> -<br />$x=<<<DD<br />jhdsjkfhjdsh<br />DD<br />."";<br />$a=<<<DDDD<br />jhdsjkfhjdsh<br />DDDD;<br /></span> -</code> diff --git a/ext/standard/tests/general_functions/is_resource.phpt b/ext/standard/tests/general_functions/is_resource.phpt deleted file mode 100644 index d44461e442..0000000000 --- a/ext/standard/tests/general_functions/is_resource.phpt +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -Bug #27822: is_resource() returns TRUE for closed resources ---FILE-- -<?php - $f = fopen(__FILE__, 'r'); - fclose($f); - var_dump(is_resource($f)); -?> ---EXPECT-- -bool(false) diff --git a/ext/standard/tests/general_functions/proc_open.phpt b/ext/standard/tests/general_functions/proc_open.phpt deleted file mode 100644 index ecf8d8ad79..0000000000 --- a/ext/standard/tests/general_functions/proc_open.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -proc_open ---SKIPIF-- -<?php # vim:syn=php -if (!is_executable("/bin/cat")) echo "skip"; -if (!function_exists("proc_open")) echo "skip proc_open() is not available"; -?> ---FILE-- -<?php -$ds = array( - 0 => array("pipe", "r"), - 1 => array("pipe", "w"), - 2 => array("pipe", "w") - ); - -$cat = proc_open( - "/bin/cat", - $ds, - $pipes - ); - -proc_close($cat); - -echo "I didn't segfault!\n"; - -?> ---EXPECT-- -I didn't segfault! diff --git a/ext/standard/tests/general_functions/sunfuncts.phpt b/ext/standard/tests/general_functions/sunfuncts.phpt deleted file mode 100644 index 4d95c59ecd..0000000000 --- a/ext/standard/tests/general_functions/sunfuncts.phpt +++ /dev/null @@ -1,44 +0,0 @@ ---TEST-- -date_sunrise() and date_sunset() functions ---INI-- -precision=13 ---FILE-- -<?php - -putenv ("TZ=Asia/Jerusalem"); - -for($a=1;$a<=12;$a++){ - echo date_sunrise(mktime(1,1,1,$a,1,2003),SUNFUNCS_RET_TIMESTAMP,31.76670,35.23330,90.83,2)." "; - echo date_sunrise(mktime(1,1,1,$a,1,2003),SUNFUNCS_RET_STRING,31.76670,35.23330,90.83,2)." "; - echo date_sunrise(mktime(1,1,1,$a,1,2003),SUNFUNCS_RET_DOUBLE,31.76670,35.23330,90.83,2)."\n"; - - echo date_sunset(mktime(1,1,1,$a,1,2003),SUNFUNCS_RET_TIMESTAMP,31.76670,35.23330,90.83,2)." "; - echo date_sunset(mktime(1,1,1,$a,1,2003),SUNFUNCS_RET_STRING,31.76670,35.23330,90.83,2)." "; - echo date_sunset(mktime(1,1,1,$a,1,2003),SUNFUNCS_RET_DOUBLE,31.76670,35.23330,90.83,2)."\n"; -} -?> ---EXPECTF-- -1041395864 06:37 6.6290131458%d -1041432452 16:47 16.792451114%d -1044073855 06:30 6.5154089279%d -1044112463 17:14 17.239870289%d -1046491495 06:04 6.0822145033%d -1046533075 17:37 17.632011035%d -1049167581 05:26 5.4394438111%d -1049212774 17:59 17.993035729%d -1051757532 04:52 4.8701934126%d -1051806007 18:20 18.335390508%d -1054434776 04:32 4.5489827182%d -1054485647 18:40 18.679812949%d -1057026949 04:35 4.5971956372%d -1057078197 18:49 18.832563396%d -1059706409 04:53 4.8916575089%d -1059755837 18:37 18.621440704%d -1062385999 05:13 5.2220951121%d -1062432291 18:04 18.080957168%d -1064979098 05:31 5.5273199215%d -1065021952 17:25 17.431339135%d -1067658845 05:54 5.9016292870%d -1067698274 16:51 16.853902453%d -1070252387 06:19 6.3299242689%d -1070289382 16:36 16.606312600%d |