title: Object of class stdClass could not be converted to string (php)
body: <p>I'm happy with some updates from my Website but I can't find out what I am doing wrong.</p>
  <pre><code>DB::beginTransaction();
   try {
   Log::debug('--- create ---');
   Log::debug($responsible-&gt;contactInfo);
   $firstName  = isset($responsible-&gt;firstName)  ? $responsible-&gt;firstName  : 'NoName';
   $lastName   = isset($responsible-&gt;lastName)   ? $responsible-&gt;lastName   : $firstName;
   $middleName = isset($responsible-&gt;middleName) ? $responsible-&gt;middleName : '';
   if (isset($responsible-&gt;contactInfo)) {
   foreach ($responsible-&gt;contactInfo as $key =&gt; $value) {
   if ($value &amp;&amp; property_exists($value, 'type') &amp;&amp; $value-&gt;type == 'email') {
                     $email = $value-&gt;value;
                              }
   if ($value &amp;&amp; property_exists($value, 'type') &amp;&amp; $value-&gt;type == 'phone') {
                     $phone = preg_replace('/[^0-9]/', '', $value-&gt;value);
                              }
                          }
                      }
  </code></pre>
  <p>I processing this info:</p>
  <pre><code>(
          [id] =&gt; 1000005
          [firstName] =&gt; Test
          [lastName] =&gt; John
          [middleName] =&gt; Smith
          [contactInfo] =&gt; stdClass Object
              (
                  [0] =&gt; stdClass Object
                      (
                          [type] =&gt; email
                          [value] =&gt; testtest@gmail.com
                      )
      
                  [1] =&gt; stdClass Object
                      (
                          [type] =&gt; phone
                          [value] =&gt; +380 67 777 7777
                      )
      
              )
      
          [position] =&gt; Manager
      )
  </code></pre>
  <p>And i getting this error:</p>
  <pre><code>
      [2021-09-14 15:46:18] production.INFO: responsible  
      [2021-09-14 15:46:18] production.INFO: stdClass Object
      (
          [id] =&gt; 1000005
          [firstName] =&gt; Test
          [lastName] =&gt; John
          [middleName] =&gt; Smith
          [contactInfo] =&gt; stdClass Object
              (
                  [0] =&gt; stdClass Object
                      (
                          [type] =&gt; email
                          [value] =&gt; testtest@gmail.com
                      )
      
                  [1] =&gt; stdClass Object
                      (
                          [type] =&gt; phone
                          [value] =&gt; +380 67 777 7777
                      )
      
              )
      
          [position] =&gt; Manager
      )
        
      [2021-09-14 15:46:18] production.DEBUG: --- create ---  
      [2021-09-14 15:46:18] production.ERROR: Uncaught exception 'ErrorException' with message 'Object of class stdClass could not be converted to string' in /home/www/test/vendor/monolog/monolog/src/Monolog/Logger.php:329  
  
   
  </code></pre>
  <p>I hope someone can help me with this.</p>