Fatal error on functions valid for PHP 4, 5
Fatal error on functions valid for PHP 4, 5
am 09.10.2009 15:01:24 von kronos
Hi,
Would someone be kind enough to test whether these following functions work?
I'm getting: "PHP Fatal error: Call to undefined function easter_date() . . .
easter_days" on both local and production sites.
echo easter_days(2009);
print "
";
echo date("M-d-Y", easter_date(2009));
print "
";
echo date("D d M Y", easter_date(2009));
?>
I'm using 5.2.10 production; PHP 5.2.4 local.
Tia,
Andre
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Fatal error on functions valid for PHP 4, 5
am 09.10.2009 15:20:29 von Jonathan Tapicer
What platform? If you compiled PHP yourself you need to compile with
--enable-calendar.
Jonathan
On Fri, Oct 9, 2009 at 10:01 AM, wrote:
> Hi,
>
> Would someone be kind enough to test whether these following functions wo=
rk?
>
> I'm getting: "PHP Fatal error: =A0Call to undefined function easter_date(=
) . . .
> easter_days" on both local and production sites.
>
>
>
>
> =A0 =A0 =A0 =A0echo easter_days(2009);
> =A0 =A0 =A0 =A0print "
";
> =A0 =A0 =A0 =A0echo date("M-d-Y", easter_date(2009));
> =A0 =A0 =A0 =A0print "
";
> =A0 =A0 =A0 =A0echo date("D d M Y", easter_date(2009));
>
> ?>
>
>
> I'm using 5.2.10 production; PHP 5.2.4 local.
>
> Tia,
> Andre
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Fatal error on functions valid for PHP 4, 5
am 09.10.2009 15:34:00 von Andre Dubuc
Hi Jonathon,
I'm using Mandriva 2008.0 x86_64 version (which probably didn't have that=
=20
enabled).. Thanks -- will check. Be fun trying to enable it though, given=20
Mandriva's propensity to stick stuff in weird places. Sigh . . .
Andre
On October 9, 2009 09:20:29 am Jonathan Tapicer wrote:
> What platform? If you compiled PHP yourself you need to compile with
> --enable-calendar.
>
> Jonathan
>
> On Fri, Oct 9, 2009 at 10:01 AM, wrote:
> > Hi,
> >
> > Would someone be kind enough to test whether these following functions
> > work?
> >
> > I'm getting: "PHP Fatal error: =A0Call to undefined function easter_dat=
e()
> > . . . easter_days" on both local and production sites.
> >
> >
> >
> >
> > =A0 =A0 =A0 =A0echo easter_days(2009);
> > =A0 =A0 =A0 =A0print "
";
> > =A0 =A0 =A0 =A0echo date("M-d-Y", easter_date(2009));
> > =A0 =A0 =A0 =A0print "
";
> > =A0 =A0 =A0 =A0echo date("D d M Y", easter_date(2009));
> >
> > ?>
> >
> >
> > I'm using 5.2.10 production; PHP 5.2.4 local.
> >
> > Tia,
> > Andre
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Fatal error on functions valid for PHP 4, 5
am 09.10.2009 17:01:21 von Al
kronos@aolohr.com wrote:
> Hi,
>
> Would someone be kind enough to test whether these following functions work?
>
> I'm getting: "PHP Fatal error: Call to undefined function easter_date() . . .
> easter_days" on both local and production sites.
>
>
>
>
> echo easter_days(2009);
> print "
";
> echo date("M-d-Y", easter_date(2009));
> print "
";
> echo date("D d M Y", easter_date(2009));
>
> ?>
>
>
> I'm using 5.2.10 production; PHP 5.2.4 local.
>
> Tia,
> Andre
Run get_defined_functions ( void )
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Fatal error on functions valid for PHP 4, 5
am 09.10.2009 20:46:52 von Chris Streatfield
Out put on PHP 5.2.4
Parse error: syntax error, unexpected T_STRING in /testphp.php on line 2
Line 2 is the first line of code.
Output on PHP 5.2.6 and on PHP 5.3.0 local
blank page.
All the best
Chris Streatfield
Tel: +64 4 475 7846
Mob: 021 102 6018
Skype: chrisstreat
On Sat, 10 Oct 2009 02:01:24 kronos@aolohr.com wrote:
> Hi,
>
> Would someone be kind enough to test whether these following functions work?
>
> I'm getting: "PHP Fatal error: Call to undefined function
easter_date() . . .
> easter_days" on both local and production sites.
>
>
>
>
> echo easter_days(2009);
> print "
";
> echo date("M-d-Y", easter_date(2009));
> print "
";
> echo date("D d M Y", easter_date(2009));
>
> ?>
>
>
> I'm using 5.2.10 production; PHP 5.2.4 local.
>
> Tia,
> Andre
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Fatal error on functions valid for PHP 4, 5
am 09.10.2009 22:26:16 von kronos
Thanks Chris.
Seems like the function is a dud. I have '-enable-calendar' working on both
local and production. Sigh . .
I have been using another modified 'easter' function, 'pFeast', (can't for the
life of me find it on the net now). It works well, but I need to set the
output to a variable, so I can use it for other purposes. But that's another
prob . . .
Regards,
Andree
On October 9, 2009 02:46:52 pm Chris Streatfield wrote:
> Out put on PHP 5.2.4
>
>
> Parse error: syntax error, unexpected T_STRING in /testphp.php on line 2
>
>
> Line 2 is the first line of code.
>
> Output on PHP 5.2.6 and on PHP 5.3.0 local
>
> blank page.
>
> All the best
> Chris Streatfield
> Tel: +64 4 475 7846
> Mob: 021 102 6018
> Skype: chrisstreat
>
> On Sat, 10 Oct 2009 02:01:24 kronos@aolohr.com wrote:
> > Hi,
> >
> > Would someone be kind enough to test whether these following functions
> > work?
> >
> > I'm getting: "PHP Fatal error: Call to undefined function
>
> easter_date() . . .
>
> > easter_days" on both local and production sites.
> >
> >
> >
> >
> > echo easter_days(2009);
> > print "
";
> > echo date("M-d-Y", easter_date(2009));
> > print "
";
> > echo date("D d M Y", easter_date(2009));
> >
> > ?>
> >
> >
> > I'm using 5.2.10 production; PHP 5.2.4 local.
> >
> > Tia,
> > Andre
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Fatal error on functions valid for PHP 4, 5
am 09.10.2009 23:17:18 von Shawn McKenzie
kronos@aolohr.com wrote:
> Thanks Chris.
>
> Seems like the function is a dud. I have '-enable-calendar' working on both
> local and production. Sigh . .
>
> I have been using another modified 'easter' function, 'pFeast', (can't for the
> life of me find it on the net now). It works well, but I need to set the
> output to a variable, so I can use it for other purposes. But that's another
> prob . . .
>
> Regards,
> Andree
>
>
>
> On October 9, 2009 02:46:52 pm Chris Streatfield wrote:
>> Out put on PHP 5.2.4
>>
>>
>> Parse error: syntax error, unexpected T_STRING in /testphp.php on line 2
>>
>>
>> Line 2 is the first line of code.
>>
>> Output on PHP 5.2.6 and on PHP 5.3.0 local
>>
>> blank page.
>>
>> All the best
>> Chris Streatfield
>> Tel: +64 4 475 7846
>> Mob: 021 102 6018
>> Skype: chrisstreat
>>
>> On Sat, 10 Oct 2009 02:01:24 kronos@aolohr.com wrote:
>>> Hi,
>>>
>>> Would someone be kind enough to test whether these following functions
>>> work?
>>>
>>> I'm getting: "PHP Fatal error: Call to undefined function
>> easter_date() . . .
>>
>>> easter_days" on both local and production sites.
>>>
>>>
>>>
>>>
>>> echo easter_days(2009);
>>> print "
";
>>> echo date("M-d-Y", easter_date(2009));
>>> print "
";
>>> echo date("D d M Y", easter_date(2009));
>>>
>>> ?>
>>>
>>>
>>> I'm using 5.2.10 production; PHP 5.2.4 local.
>>>
>>> Tia,
>>> Andre
>>>
>>> --
>>> PHP General Mailing List (http://www.php.net/)
>>> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
Well, I'm not sure why you don't have the function, but if you scroll to
the bottom of http://us2.php.net/manual/en/function.easter-date.php:
if(!function_exists('easter_date')) {
function easter_date ($Year)
{
/*
G is the Golden Number-1
H is 23-Epact (modulo 30)
I is the number of days from 21 March to the Paschal full moon
J is the weekday for the Paschal full moon (0=Sunday,
1=Monday, etc.)
L is the number of days from 21 March to the Sunday on or before
the Paschal full moon (a number between -6 and 28)
*/
$G = $Year % 19;
$C = (int)($Year / 100);
$H = (int)($C - (int)($C / 4) - (int)((8*$C+13) / 25) + 19*$G + 15) % 30;
$I = (int)$H - (int)($H / 28)*(1 - (int)($H / 28)*(int)(29 / ($H +
1))*((int)(21 - $G) / 11));
$J = ($Year + (int)($Year/4) + $I + 2 - $C + (int)($C/4)) % 7;
$L = $I - $J;
$m = 3 + (int)(($L + 40) / 44);
$d = $L + 28 - 31 * ((int)($m / 4));
$y = $Year;
$E = mktime(0,0,0, $m, $d, $y);
return $E;
}
}
--
Thanks!
-Shawn
http://www.spidean.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Fatal error on functions valid for PHP 4, 5 [RESOLVED]
am 10.10.2009 00:16:42 von kronos
On October 9, 2009 05:17:18 pm you wrote:
> kronos@aolohr.com wrote:
> > Thanks Chris.
> >
> > Seems like the function is a dud. I have '-enable-calendar' working on
> > both local and production. Sigh . .
> >
> > I have been using another modified 'easter' function, 'pFeast', (can't
> > for the life of me find it on the net now). It works well, but I need to
> > set the output to a variable, so I can use it for other purposes. But
> > that's another prob . . .
> >
> > Regards,
> > Andree
> >
> > On October 9, 2009 02:46:52 pm Chris Streatfield wrote:
> >> Out put on PHP 5.2.4
> >>
> >>
> >> Parse error: syntax error, unexpected T_STRING in /testphp.php on line 2
> >>
> >>
> >> Line 2 is the first line of code.
> >>
> >> Output on PHP 5.2.6 and on PHP 5.3.0 local
> >>
> >> blank page.
> >>
> >> All the best
> >> Chris Streatfield
> >> Tel: +64 4 475 7846
> >> Mob: 021 102 6018
> >> Skype: chrisstreat
> >>
> >> On Sat, 10 Oct 2009 02:01:24 kronos@aolohr.com wrote:
> >>> Hi,
> >>>
> >>> Would someone be kind enough to test whether these following functions
> >>> work?
> >>>
> >>> I'm getting: "PHP Fatal error: Call to undefined function
> >>
> >> easter_date() . . .
> >>
> >>> easter_days" on both local and production sites.
> >>>
> >>>
> >>>
> >>>
> >>> echo easter_days(2009);
> >>> print "
";
> >>> echo date("M-d-Y", easter_date(2009));
> >>> print "
";
> >>> echo date("D d M Y", easter_date(2009));
> >>>
> >>> ?>
> >>>
> >>>
> >>> I'm using 5.2.10 production; PHP 5.2.4 local.
> >>>
> >>> Tia,
> >>> Andre
> >>>
> >>> --
> >>> PHP General Mailing List (http://www.php.net/)
> >>> To unsubscribe, visit: http://www.php.net/unsub.php
>
> Well, I'm not sure why you don't have the function, but if you scroll to
> the bottom of http://us2.php.net/manual/en/function.easter-date.php:
>
> if(!function_exists('easter_date')) {
> function easter_date ($Year)
> {
> /*
> G is the Golden Number-1
> H is 23-Epact (modulo 30)
> I is the number of days from 21 March to the Paschal full moon
> J is the weekday for the Paschal full moon (0=Sunday,
> 1=Monday, etc.)
> L is the number of days from 21 March to the Sunday on or before
> the Paschal full moon (a number between -6 and 28)
> */
> $G = $Year % 19;
> $C = (int)($Year / 100);
> $H = (int)($C - (int)($C / 4) - (int)((8*$C+13) / 25) + 19*$G + 15) % 30;
> $I = (int)$H - (int)($H / 28)*(1 - (int)($H / 28)*(int)(29 / ($H +
> 1))*((int)(21 - $G) / 11));
> $J = ($Year + (int)($Year/4) + $I + 2 - $C + (int)($C/4)) % 7;
> $L = $I - $J;
> $m = 3 + (int)(($L + 40) / 44);
> $d = $L + 28 - 31 * ((int)($m / 4));
> $y = $Year;
> $E = mktime(0,0,0, $m, $d, $y);
>
> return $E;
> }
> }
Thanks Shawn!
Actually, I've given up on the PHP function, and managed to extract the info I
need from 'pFeast' class. This class uses the same code as above but with
some major enhancements.
A little bit more work on the code, and it'll be accomplishing what I need.
Thanks for your suggestion!
Regards,
Andre
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php