Related Links : Search Engine Optimization | | Search Engine Marketing | Online Marketing | Freelance Programmer| SEO Thailand | SEO Expert | SEO services | PHP Programmer Thailand | SEO Tutorial | What is SEO |

  Home Our SEO Services SEO Expert Consultant Php Programmer Scripts| Email : sachin {at} jainsachin {dot} com

PHP | What References Are Not | Manual | Tutorial | Help

SEO Services



Website Programming in PHP / MYSQL



Friends


    What References Are Not

    What References Are Not

    As said before, references aren't pointers. That means, the following construct won't do what you expect:

    <?php
    function foo(&$var)
    {
        
    $var =& $GLOBALS["baz"];
    }
    foo($bar); 
    ?>

    What happens is that $var in foo will be bound with $bar in caller, but then it will be re-bound with $GLOBALS["baz"]. There's no way to bind $bar in the calling scope to something else using the reference mechanism, since $bar is not available in the function foo (it is represented by $var, but $var has only variable contents and not name-to-value binding in the calling symbol table). You can use returning references to reference variables selected by the function.


    SEO Tutorial / Articles





    Php / Mysql Tutorial



    Articles



      Portfolio


      SEO by Jainsachin