|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2015-03-23 20:13 UTC] cmb@php.net
-Status: Open
+Status: Not a bug
[2015-03-23 20:13 UTC] cmb@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 03:00:02 2025 UTC |
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