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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-04-26 05:14 UTC] cynic@php.net
just not correct.
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Tue Jan 25 06:03:33 2022 UTC