Example
<?php
echo “<pre>”;
echo $test;
print_r(error_get_last());
?>
Output
Array
(
[type] => 8
[message] => Undefined variable: test
[file] => /var/www/test/index.php
[line] => 3
)
Example
<?php
echo “<pre>”;
echo $test;
print_r(error_get_last());
?>
Output
Array
(
[type] => 8
[message] => Undefined variable: test
[file] => /var/www/test/index.php
[line] => 3
)
It prints a backtrace
Example
<?php
echo “<pre>”;
function back($arg1, $arg2) {
debug_print_backtrace();
}
back(“test1”, “test2”);
?>
Output
#0 back(Peter, Griffin) called at [/var/www/test/index.php:6]
<?php
echo “<pre>”;
function back($arg1, $arg2) {
print_r(debug_backtrace());
}
back(“test1”, “test2”);
?>
The possible elements that can be returned are given below
function,line,file,class,object,type,Returns: “->” ,Returns: “::” ,Returns nothing,args
Output
Array
(
[0] => Array
(
[file] => /var/www/test/index.php
[line] => 6
[function] => back
[args] => Array
(
[0] => Peter
[1] => Griffin
)
)
)
Example
<?php
echo unixtojd();
?>
Output
2456045
Example
<?php
$jdate = juliantojd(8,4,1976);
echo $jdate . “<br />”;
$julian = jdtojulian($jdate);
echo $julian;
?>
Output
2443008
8/4/1976
Example
<?php
echo jewishtojd(3,3,5762);
?>
Output
2452232
It convert Julian Day to Unix timestamp
Example
<?php
$jdate = gregoriantojd(10,3,1970);
echo jdtounix($jdate);
?>
Output
23760000
Example
<?php
$date = juliantojd(9,2,1977);
echo $date . “<br />”;
$julian = jdtojulian($date);
echo $julian;
?>
Output
2443402
9/2/1977
Example
<?php
echo jdtojewish(gregoriantojd(9,7,2000)) . “<br />”;
echo jdtojewish(gregoriantojd(9,7,2000),true);
?>
Output
13/7/5760
æ àìåì äúùñ
<?php
$date = gregoriantojd(9,4,1976);
echo $date . “<br />”;
$gregorian = jdtogregorian($date);
echo $gregorian;
?>
Output
2443026
9/4/1976