Why can I pass a non-existent variable by reference? [duplicate]
This question already has answers here: Why php does not complain when referencing a non existing variable? (2 answers) Closed last month. Today I encountered a behaviour which I did not expect in PHP 8.2. See following code: Code function foo(&$undefined) { if (is_null($undefined)) { return sprintf(‘value: “%s”‘, $undefined); } } print(foo($undefined)) . “n”; var_dump($undefined); […]