![]() |
|
[PHP] Strict standards: Only variables should be passed by reference in - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Web Development (https://hackforums.net/forumdisplay.php?fid=183) +---- Thread: [PHP] Strict standards: Only variables should be passed by reference in (/showthread.php?tid=5000741) |
Strict standards: Only variables should be passed by reference in - Idolize - Sep 26, 2015 So this is the error I am getting basically. ![]() Here is the code: PHP Code Basically, I have a folder full of logs, I want it to print out every IP that is connected with this username, but removing the duplicates and looking through all the .log files. * - Yck - Sep 26, 2015 What is the $log, value or an array? array_pop expects an array variable (by reference), not a value. * - Novalty - Sep 26, 2015 Here is your problem... PHP Code array_pop takes an argument that is passed by reference. That means you must give it a variable whereas you are just passing in an array which is returned from glob. Changing it to the following should fix the issue: PHP Code * - Idolize - Sep 26, 2015 Now it wont print out anything :/ * - c00perzz - Sep 26, 2015 Either im confused, or : a) there is no array to remove from b) $log = array_pop(glob('logs/debug-*-*.log')); will end up in an empty array since its removing all log files. Shouldnt it be like this? : PHP Code |