php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #10506 Using a variable as a mathematical operator
Submitted: 2001-04-26 05:06 UTC Modified: 2001-04-26 05:14 UTC
From: jdj at darkside dot dynup dot net Assigned:
Status: Not a bug Package: Feature/Change Request
PHP Version: 4.0.4pl1 OS: Linux, but not important
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: jdj at darkside dot dynup dot net
New email:
PHP Version: OS:

 

 [2001-04-26 05:06 UTC] jdj at darkside dot dynup dot net

I am parsing the Date: header of an email address, which includes a GMT offset in the form [+|-]%4d.  Ideally, one of the following would work. ;)

$hour_mins = '0600';
$gmt_offset = '+0200';

$hour_mins = $hour_mins $gmt_offset[0] substr ($gmt_offset, 1);
That returns a parse error.. as does the short form of that (+=).

As it is now, I'm switch()'ing the $gmt_offset[0].
$hour_mins += substr ($gmt_offset, 1); works..
$hour_mins = $hour_mins + substr ($gmt_offset, 1); works..

Is this unsupported for any particular reason.. or am I just not syntactically correct?

Thanks!
Jeremy

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-04-26 05:14 UTC] cynic@php.net
just not correct.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Sep 15 07:01:27 2024 UTC