Skip to content

Instantly share code, notes, and snippets.

View sirolad's full-sized avatar
🏠
Working from home

Surajudeen Akande sirolad

🏠
Working from home
View GitHub Profile
@msankhala
msankhala / ampersand-before-php-function-names.php
Last active June 13, 2022 14:15
Understanding Ampersand Before PHP Function Names – Returning By Reference
<?php
// You may have wondered how a PHP function defined as below behaves:
function &config_byref()
{
static $var = "hello";
return $var;
}
// the value we get is "hello"
$byref_initial = config_byref();