2

I'm getting this error:

Strict Standards: Only variables should be passed by reference in /home/mydomain/public_html/printshop/upload_2-img-dpi.php on line 55

These are lines 49 to 56:

if(!is_dir($upload_dir)){
    mkdir($upload_dir, 0777, TRUE);
    chmod($upload_dir, 0777);
}       

    $value = explode(".", $userfile_name); // line 55
    $file_ext = strtolower(array_pop($value)); 

What's wrong? This code was working fine before I got APC installed on my server.

user961627
  • 12,379
  • 42
  • 136
  • 210
  • 3
    And what is the line 54? – Molecular Man Jul 23 '13 at 09:33
  • 1
    I [can't reproduce](http://3v4l.org/I0deH#v431) the error on several PHP versions. Are you sure you're referring to the right file/lines ? – HamZa Jul 23 '13 at 10:00
  • I just edited my question to include more lines of code. Yes I really am using the right lines/file. Does this have anything to do with error options? Or the fact that APC was just installed on the server? – user961627 Jul 23 '13 at 10:35
  • possible duplicate of [Strict Standards: Only variables should be passed by reference](http://stackoverflow.com/questions/2354609/strict-standards-only-variables-should-be-passed-by-reference) – Lorenz Meyer Jun 21 '14 at 08:32

1 Answers1

2

Okay, I did this, and it worked:

    $value = array();
    $value = explode(".", $userfile_name);
    $file_ext = strtolower(end($value)); 

shrug

user961627
  • 12,379
  • 42
  • 136
  • 210
  • [php 6.0 should introduce E_DOESNT_WORK and E_LOLWUT](http://chat.stackoverflow.com/transcript/11?m=10722135#10722135) – HamZa Jul 23 '13 at 10:42