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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: nick dot mitin at gmail dot com
New email:
PHP Version: OS:

 

 [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-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 07:01:27 2024 UTC