php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #56188 PHPScript does not respect ScriptControl.Reset
Submitted: 2004-09-06 12:02 UTC Modified: 2015-03-23 20:13 UTC
From: codemastr at unrealircd dot com Assigned:
Status: Not a bug Package: PHPScript (PECL)
PHP Version: 5CVS-2004-09-06 (dev) OS: Windows XP Home
Private report: No CVE-ID: None
 [2004-09-06 12:02 UTC] codemastr at unrealircd dot com
Description:
------------
When you call ScriptControl.Reset, the script should be reset to its initial state. This is what happens for all other languages, but not PHPScript.

Reproduce code:
---------------
var sc = new ActiveXObject("ScriptControl");
sc.Language = "PHPScript";
sc.AddObject("WScript", WScript);
sc.AddCode("function test() { $WScript->Echo('test'); } test();");
sc.Reset();
sc.AddCode("test();");

cscript /e:JScript thatfile.wsf

Expected result:
----------------
The expected result is that it should print "test" then return an error indicating that test is undefined (Reset removed the test function). The PHPScript should function like the below JScript code:

var sc = new ActiveXObject("ScriptControl");
sc.Language = "JScript";
sc.AddObject("WScript", WScript);
sc.AddCode("function test() { WScript.Echo('test'); } test();");
sc.Reset();
sc.AddCode("test();");

cscript /e:JScript thatfile.wsf

Actual result:
--------------
In PHPScript, the Reset is ignored and so the output is:

test
test

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-03-23 20:13 UTC] cmb@php.net
-Status: Open +Status: Not a bug
 [2015-03-23 20:13 UTC] cmb@php.net
Thank you for taking the time to report a problem with PHP.
Unfortunately you are not using a current version of PHP -- 
the problem might already be fixed. Please download a new
PHP version from http://www.php.net/downloads.php

If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Mon Sep 16 00:01:27 2019 UTC