php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #52107 Eval does not recognize local scope variables
Submitted: 2010-06-17 08:26 UTC Modified: 2013-02-18 00:34 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: nick dot mitin at gmail dot com Assigned:
Status: No Feedback Package: Scripting Engine problem
PHP Version: 5.3.2 OS: Ubuntu 10.04 32bit
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 — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
27 + 12 = ?
Subscribe to this entry?

 
 [2010-06-17 08:26 UTC] nick dot mitin at gmail dot com
Description:
------------
Sometimes under undetermined conditions eval() does not see the local scope function variables.


$returnTo = $_SERVER['REQUEST_URI'];
eval('$this->content = "' . $this->application->getTemplate('/admin/user/login/login') . '";');

Assuming that I have $returnTo variable inside a '/admin/user/login/login', I see the "Notice: undefined variable $returnTo", while evaling it.

But, If I create a dummy function moo() and eval somthing there the notice is gone.

See whole listing for details.


Test script:
---------------
Whole listing: http://kinokapsula.artgorbunov.ru/bug.php


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-11-15 15:51 UTC] felipe@php.net
Please try using this snapshot:

  http://snaps.php.net/php5.3-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/


 [2011-11-15 15:51 UTC] felipe@php.net
-Status: Open +Status: Feedback
 [2013-02-18 00:34 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Wed Dec 07 13:03:50 2022 UTC