Why assign by reference ? (2 posts)

  1. mp2300
    Posted 6 years ago #

    Many of the WP_* global objects are created in wp-setings.php with assign by reference:
    $wp_widget_factory =& new WP_Widget_Factory();

    What are the benefits of this approach. It breaks some of my scripts, and makes it impossible to load the WordPress enviroment from external PHP files.

  2. esmi
    Forum Moderator
    Posted 6 years ago #

    Doesn't passing by reference allow you to access the same variable content by different names? I'd imagine that allows for far more "re-usable" code blocks.


Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.