|
发表于 2019-7-17 23:26:05
|
显示全部楼层
广东省珠海市
- //php代码
- <?php
- $jsData = file_get_contents("c.js");
- $JS = new COM("MSScriptControl.ScriptControl");
- $JS->Language = "JavaScript";
- $JS->AllowUI = false;
- $JS->AddCode("$jsData");
- //$test = $JS->Run("a", "111", "222");
- $test = $JS->Run("b", "111");
- echo $test;
- ?>
复制代码- //js代码
- function a(a,b) {
- return a+b;
- }
- function b(a) {
- return a;
- }
复制代码 $JS->Run("b", "111"); 调用正常
$JS->Run("a", "111", "222"); 调用时提示“Fatal error: Cannot pass parameter 3 by reference”,也就是说我这样写只能传递一个参数进去
php不太懂,麻烦大佬帮忙看看是什么问题
|
|