php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57696 Interpreter loses all variables
Submitted: 2007-06-08 15:55 UTC Modified: 2017-04-01 21:26 UTC
From: info at silvermoon-software dot de Assigned:
Status: Wont fix Package: PHPScript (PECL)
PHP Version: 5.2.1 OS: Windows
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2007-06-08 15:55 UTC] info at silvermoon-software dot de
Description:
------------
Like in #9406 reported, the interpretet loses the variables and includes after the host adds the script by AddCode(BSTR).

After AddCode, the script will be executed and the interpreter seems to be ended.

If the host calls an procedure with ->Run("prodecure","parameters") the variables and includes outside the procedure are empty

Reproduce code:
---------------
This Code in for Visual Basic (5/6)
  Set script = CreateObject("MSScriptControl.ScriptControl.1")
  script.Language = "PHPScript"
  script.AddObject "WScript", CreateObject("WScript.Shell")
  script.AllowUI = True
  script.UseSafeSubset = False
  script.AddCode "$a = 0; $b = 1; $c = 'a'; function abc() { global $b; $WScript->Popup($b); } $WScript->Popup($b);"
  script.run "abc"


Expected result:
----------------
---------------------------
Windows Script Host
---------------------------
1
---------------------------
OK   
---------------------------

An dialog showing the content of $b (which is 1) - the dialog should be shown 2 times

Actual result:
--------------
The dialog appears online 1 time, the call of "abc" results in an error

Uncaught exception 'com_exception' with message 'Parameter 0: Typkonflikt.
' in fragment:1
Stack trace:
#0 fragment(1): variant->Popup(NULL)
#1 [internal function]: abc()
#2 {main}
  thrown

As you can see.. $b is NULL

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-04-01 21:26 UTC] tpunt@php.net
-Status: Open +Status: Wont fix
 [2017-04-01 21:26 UTC] tpunt@php.net
Due to this extension not seeing any activity since 2009, this issue will not be fixed. We are therefore closing this now.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Mon Nov 30 01:01:22 2020 UTC