Title: PHP Err: undefined offset in Minify.php
Last modified: August 31, 2016

---

# PHP Err: undefined offset in Minify.php

 *  [pietari-pate](https://wordpress.org/support/users/pietari-pate/)
 * (@pietari-pate)
 * [10 years ago](https://wordpress.org/support/topic/php-err-undefined-offset-in-minifyphp/)
 * Hello
 * My Apache logs are filled with:
 * [Wed Jun 08 12:31:58.689816 2016] [:error] [pid 23909] [client xxx] PHP Notice:
   Undefined offset: 0 in /home/xxx/public/xxx/wp/wp-content/plugins/w3-total-cache/
   lib/W3/Plugin/Minify.php on line 165
 * WP 4.5.2 and W3TC 0.9.4.1
 * Can I do something?
 * BR and thanks!
 * [https://wordpress.org/plugins/w3-total-cache/](https://wordpress.org/plugins/w3-total-cache/)

Viewing 5 replies - 1 through 5 (of 5 total)

 *  [Ashok](https://wordpress.org/support/users/bappidgreat/)
 * (@bappidgreat)
 * [10 years ago](https://wordpress.org/support/topic/php-err-undefined-offset-in-minifyphp/#post-7458118)
 * Hi pietari-pate
 * What is your php version?
 * And would you please go to /home/xxx/public/xxx/wp/wp-content/plugins/w3-total-
   cache/lib/W3/Plugin/Minify.php on line 165 and replace
    `&$this` with `$this`
 * Let us know if you get the notice then too.
 * Have an awesome day!
 * Cheers
    Ash
 *  Thread Starter [pietari-pate](https://wordpress.org/support/users/pietari-pate/)
 * (@pietari-pate)
 * [10 years ago](https://wordpress.org/support/topic/php-err-undefined-offset-in-minifyphp/#post-7458122)
 * Not finding that.
 * &$this appears only inside the run function. Three times in there.
 *  [Ashok](https://wordpress.org/support/users/bappidgreat/)
 * (@bappidgreat)
 * [10 years ago](https://wordpress.org/support/topic/php-err-undefined-offset-in-minifyphp/#post-7458168)
 * You need to check line no 165. What do you see in there?
 *  [mgoncalo](https://wordpress.org/support/users/mgoncalo/)
 * (@mgoncalo)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/php-err-undefined-offset-in-minifyphp/#post-7458254)
 * Same problem.
 * My line 165 is
 * `$embed_pos = strlen($match[0][0]) + $match[0][1];`
 *  [Ashok](https://wordpress.org/support/users/bappidgreat/)
 * (@bappidgreat)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/php-err-undefined-offset-in-minifyphp/#post-7458255)
 * Ahh yes, my bad, I am sorry, I was looking at wrong file.
 * Would you please replace
 *     ```
       $embed_pos = strlen($match[0][0]) + $match[0][1];
       ```
   
 * with the following?
 *     ```
       $embed_pos = isset( $match[0][0] ) && isset( $match[0][1] ) ? strlen($match[0][0]) + $match[0][1] : 0;
       ```
   
 * Hope it helps 🙂 Please feel free to ask more question if you have any.
 * Cheers
    Ash

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘PHP Err: undefined offset in Minify.php’ is closed to new replies.

 * ![](https://ps.w.org/w3-total-cache/assets/icon-256x256.png?rev=1041806)
 * [W3 Total Cache](https://wordpress.org/plugins/w3-total-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/w3-total-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/w3-total-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/w3-total-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/w3-total-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/w3-total-cache/reviews/)

## Tags

 * [php-error](https://wordpress.org/support/topic-tag/php-error/)

 * 5 replies
 * 3 participants
 * Last reply from: [Ashok](https://wordpress.org/support/users/bappidgreat/)
 * Last activity: [9 years, 11 months ago](https://wordpress.org/support/topic/php-err-undefined-offset-in-minifyphp/#post-7458255)
 * Status: not resolved