title: array_diff_assoc() argument #1 is not an array php
body: <p>So I have this object:</p>
  
  <pre><code>[
      {
          "id":1,
          "name":"create-users",
          "display_name":"Create user",
          "description":"Add new user"
      },
      {
          "id":2,
          "name":"edit-user",
          "display_name":"Edit user",
          "description":"Edit existing user"
      },
      {
          "id":3,
          "name":"create-post",
          "display_name":"Create post",
          "description":"create new post"
      },
      {
          "id":4,
          "name":"edit-post",
          "display_name":"Edit post",
          "description":"edit existing post"
      }
  ]
  </code></pre>
  
  <p>and this other one:</p>
  
  <pre><code>[
      {
          "id":3,
          "name":"create-post",
          "display_name":"Create post",
          "description":"create new post"
      },
      {
          "id":4,
          "name":"edit-post",
          "display_name":"Edit post",
          "description":"edit existing post"
      }
  ]
  </code></pre>
  
  <p>Now I am looping through these two objects in nested foreach loops top compare which of the arrays from the two objects are equal(equal key and value pairs).</p>
  
  <p>Here are the foreach loops:</p>
  
  <pre><code>foreach ($role_perms as $role_perm) {
      foreach ($all_perms as $all_perm) {
          if (array_diff_assoc($all_perm, $role_perm)) {
              $all_perm['check'] = 1;
          }
      }
  }
  </code></pre>
  
  <p>But I have no idea why I keep getting the error</p>
  
  <blockquote>
    <p>array_diff_assoc(): Argument #1 is not an array 
    (on the line of code with the if statement.)</p>
  </blockquote>
  
  <p>Am I doing something wrong? Thanks for any help</p>