strict

Why is JSHINT complaining that this is a strict violation?

孤街浪徒 提交于 2019-11-26 10:49:09
问题 I think this may be a duplicate of Strict Violation using this keyword and revealing module pattern I have this code: function gotoPage(s){ if(s<=this.d&&s>0){this.g=s; this.page((s-1)*this.p.size);} } function pageChange(event, sorter) { var dd = event.currentTarget; gotoPage.call(sorter, dd[dd.selectedIndex].value); } And JSHINT (JSLINT) is complaining. It says \"Strict violation.\" for the highlighted line: Is my use of Function.call() and then referencing the instance, somehow

Strict Standards: mysqli_next_result() error with mysqli_multi_query

你。 提交于 2019-11-26 01:36:26
问题 I have tried using multi_query but I keep getting a strict Standards message popping up. $querystring = \"INSERT INTO responses VALUES(\'1\', \'2\', \'3\', \'4\'); INSERT INTO responses VALUES(\'1\', \'2\', \'3\', \'4\')\"; if (mysqli_multi_query($db, $querystring)) { do { if ($result = mysqli_store_result($db)) { // } } while (mysqli_next_result($db)); } echo \"end\"; The error message I get is: Strict Standards : mysqli_next_result(): There is no next result set. Please, call mysqli_more

Strict Standards: Only variables should be passed by reference

本小妞迷上赌 提交于 2019-11-25 21:45:11
问题 $el = array_shift($instance->find(..)) The above code somehow reports the strict standars warning,but this will not: function get_arr(){ return array(1,2); } $el = array_shift(get_arr()); So when will it report the warning anyway? 回答1: Consider the following code: error_reporting(E_STRICT); class test { function test_arr(&$a) { var_dump($a); } function get_arr() { return array(1,2); } } $t= new test; $t->test_arr($t->get_arr()); This will generate the following output: Strict Standards: Only