php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28420 Looses variable in exception
Submitted: 2004-05-17 15:44 UTC Modified: 2004-05-19 22:40 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: m at saffitz dot com Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5.0.0RC2 OS: Mac OS 10.3
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
33 - 26 = ?
Subscribe to this entry?

 
 [2004-05-17 15:44 UTC] m at saffitz dot com
Description:
------------
I have a very standard session handler I'm writing, with 
the write function as below.

I'm using propel (propel.phpdb.org) as an object 
persistence layer.

When the function is called automatically by the session 
system, the first print statement correctly prints the 
session id.  However, an exception is thrown when the 
record does not yet exist in the database, and the catch 
block in entered.  Here, the second print statement 
incorrectly prints $id, printing instead some path:

Output:

0a900f631d4ebf175f7b85ec262ca7292
/Users/msaffitz/cvswork/aspen-in
Failed to select one and only one row.
/Users/msaffitz/cvswork/aspen-in

Reproduce code:
---------------
 public function write( $id, $val ) { 
    print "$id<br>\n";
    try { 
      $session = SessionsPeer::retrieveByPk($id); 
    }
    catch ( PropelException $exception ) {
      print "$id<br>\n";
      print $exception->getMessage();
      $session = new Sessions();
      $session->setId($id);
    }
    print $id;
    $session->setDatavalue($val);
    $session->setModificationDate('NOW()');
    $session->save();
  }
 

Expected result:
----------------
The variable $id's value should persist.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-05-19 22:40 UTC] m at saffitz dot com
Retracting the bug report...  appears to not be a PHP 
issue.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Jun 26 12:01:28 2024 UTC