<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Talha Shinwari</title>
    <description>The latest articles on DEV Community by Talha Shinwari (@talha_khan74).</description>
    <link>https://dev.to/talha_khan74</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F561478%2F6c015e01-e674-4b2a-a2ba-80966a632bda.jpg</url>
      <title>DEV Community: Talha Shinwari</title>
      <link>https://dev.to/talha_khan74</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/talha_khan74"/>
    <language>en</language>
    <item>
      <title>Variable by Reference &amp; Variable by Value in PHP</title>
      <dc:creator>Talha Shinwari</dc:creator>
      <pubDate>Tue, 13 Aug 2024 19:10:10 +0000</pubDate>
      <link>https://dev.to/talha_khan74/variable-by-reference-variable-by-value-in-php-25om</link>
      <guid>https://dev.to/talha_khan74/variable-by-reference-variable-by-value-in-php-25om</guid>
      <description>&lt;p&gt;In PHP, variables can be passed in two primary ways: by value and by reference. Understanding the difference between these two concepts is crucial for effective PHP programming.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Variable by Value
&lt;/h3&gt;

&lt;p&gt;When you pass a variable by value, a copy of the original value is made and assigned to the new variable. This means that changes made to the new variable do not affect the original variable.&lt;br&gt;
Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$a = 5;
$b = $a; // $b is assigned the value of $a
$b = 10;

echo $a; // Outputs: 5
echo $b; // Outputs: 10
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, $b is a copy of $a. Changing $b does not affect $a.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Variable by Reference
&lt;/h3&gt;

&lt;p&gt;When a variable is assigned by reference, both variables point to the same memory location. Changes to one variable will affect the other.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$a = 5;
$b = &amp;amp;$a; // $b is a reference to $a
$b = 10;

echo $a; // Outputs: 10
echo $b; // Outputs: 10
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, $b is a reference to $a. Changing $b also changes $a because they both refer to the same value.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Passing by value creates a new copy, which uses more memory, while passing by reference uses the same memory location.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;n pass-by-value, changes to the new variable do not affect the original. In pass-by-reference, changes to either variable affect the other.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  When to Use Each?
&lt;/h4&gt;

&lt;p&gt;Pass by Value: Use when you want to keep the original variable unchanged.&lt;br&gt;
Pass by Reference: Use when you need to modify the original variable within a function or another context.&lt;/p&gt;

&lt;p&gt;Understanding the difference between passing variables by value and by reference in PHP helps in writing efficient and predictable code. Use pass-by-reference when you need to alter the original variable, and pass-by-value when you want to preserve the original data.&lt;/p&gt;

</description>
      <category>php</category>
      <category>laravel</category>
      <category>webdev</category>
      <category>backend</category>
    </item>
    <item>
      <title>Mini Profile Card in HTML CSS</title>
      <dc:creator>Talha Shinwari</dc:creator>
      <pubDate>Fri, 28 Jan 2022 11:32:32 +0000</pubDate>
      <link>https://dev.to/talha_khan74/mini-profile-card-in-html-css-3pa0</link>
      <guid>https://dev.to/talha_khan74/mini-profile-card-in-html-css-3pa0</guid>
      <description>&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/Talha_shinwari/embed/PoOqRJL?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>codepen</category>
      <category>css</category>
      <category>html</category>
      <category>projects</category>
    </item>
    <item>
      <title>Random background LogIn page in HTML CSS</title>
      <dc:creator>Talha Shinwari</dc:creator>
      <pubDate>Tue, 25 Jan 2022 16:07:01 +0000</pubDate>
      <link>https://dev.to/talha_khan74/random-background-login-page-in-html-css-4leh</link>
      <guid>https://dev.to/talha_khan74/random-background-login-page-in-html-css-4leh</guid>
      <description>&lt;p&gt;I Design this LogIn page with random background images through Unsplash API, By every refresh, it will be different. Highly recommended for beginners to master their basic skills.&lt;/p&gt;

&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/Talha_shinwari/embed/RwjwVKM?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>codepen</category>
      <category>html</category>
      <category>css</category>
      <category>frontend</category>
    </item>
    <item>
      <title>Academic Calender in HTML-Only</title>
      <dc:creator>Talha Shinwari</dc:creator>
      <pubDate>Wed, 19 Jan 2022 16:19:17 +0000</pubDate>
      <link>https://dev.to/talha_khan74/academic-calender-in-html-only-20p8</link>
      <guid>https://dev.to/talha_khan74/academic-calender-in-html-only-20p8</guid>
      <description>&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/Talha_shinwari/embed/XWewpym?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>beginners</category>
      <category>html</category>
      <category>css</category>
    </item>
    <item>
      <title>Time Table with only HTML</title>
      <dc:creator>Talha Shinwari</dc:creator>
      <pubDate>Wed, 19 Jan 2022 06:55:16 +0000</pubDate>
      <link>https://dev.to/talha_khan74/time-table-with-only-html-23d0</link>
      <guid>https://dev.to/talha_khan74/time-table-with-only-html-23d0</guid>
      <description>&lt;p&gt;&lt;strong&gt;This is an HTML-only Time table design, you can practice the table attribute very well. Get the idea from the attached source code and design your own.&lt;/strong&gt;&lt;br&gt;
&lt;iframe height="600" src="https://codepen.io/Talha_shinwari/embed/GRMLbQQ?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>codepen</category>
      <category>html</category>
      <category>codenewbie</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Flexbox Practice HTML, CSS</title>
      <dc:creator>Talha Shinwari</dc:creator>
      <pubDate>Fri, 10 Dec 2021 16:27:41 +0000</pubDate>
      <link>https://dev.to/talha_khan74/flexbox-practice-html-css-2pm6</link>
      <guid>https://dev.to/talha_khan74/flexbox-practice-html-css-2pm6</guid>
      <description>&lt;h2&gt;
  
  
  HTML
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;body&amp;gt;

        &amp;lt;div class="container"&amp;gt;
        &amp;lt;div class="flex"&amp;gt;ONE&amp;lt;/div&amp;gt;
        &amp;lt;div class="flex"&amp;gt;TWO&amp;lt;/div&amp;gt;
        &amp;lt;div class="flex"&amp;gt;THREE&amp;lt;/div&amp;gt;
        &amp;lt;div class="flex"&amp;gt;FOUR&amp;lt;/div&amp;gt;
        &amp;lt;div class="flex"&amp;gt;FIVE&amp;lt;/div&amp;gt;
        &amp;lt;div class="flex"&amp;gt;SIX&amp;lt;/div&amp;gt;
        &amp;lt;div class="flex"&amp;gt;SEVEN&amp;lt;/div&amp;gt;
        &amp;lt;div class="flex"&amp;gt;EIGHT&amp;lt;/div&amp;gt;
    &amp;lt;/div&amp;gt;

&amp;lt;/body&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  CSS
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.container{
    display: flex;
    flex-wrap: wrap;
    background-color: darkmagenta;
    justify-content: flex-start;

}

.flex{
    display: flex;
    width: 200px;
    height: 200px;
    margin: 10px;
    border: 2px solid black;
    border-radius: 5px;
    box-sizing: border-box;
    background-color: yellow;
    justify-content: center; 
    align-items: center; 
   font-size: large;
   font-weight: 1000;
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/Talha_shinwari/embed/BawLdGd?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>codepen</category>
    </item>
    <item>
      <title>Social Network</title>
      <dc:creator>Talha Shinwari</dc:creator>
      <pubDate>Thu, 16 Sep 2021 12:15:47 +0000</pubDate>
      <link>https://dev.to/talha_khan74/social-network-5d2l</link>
      <guid>https://dev.to/talha_khan74/social-network-5d2l</guid>
      <description>&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/Zhamilia/embed/mdmgweW?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>codepenhtmlcssprojectswebdev</category>
    </item>
    <item>
      <title>Landing page</title>
      <dc:creator>Talha Shinwari</dc:creator>
      <pubDate>Thu, 16 Sep 2021 12:14:38 +0000</pubDate>
      <link>https://dev.to/talha_khan74/landing-page-1lh1</link>
      <guid>https://dev.to/talha_khan74/landing-page-1lh1</guid>
      <description>&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/Zhamilia/embed/yLbrbmx?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>codepen</category>
    </item>
  </channel>
</rss>
