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
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:
45 - 38 = ?
Subscribe to this entry?

 
 [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: Wed Dec 11 10:01:24 2019 UTC