Skip to content

Instantly share code, notes, and snippets.

@markrandall
Created September 29, 2021 18:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save markrandall/9d9d77c0495fb1d0764ce9b346645385 to your computer and use it in GitHub Desktop.
Save markrandall/9d9d77c0495fb1d0764ce9b346645385 to your computer and use it in GitHub Desktop.
<?php
$arrInst = new class($someHugeArray) {
public function __construct(public array $someHugeArray) { }
}
foo($arrInst);
function foo($arrInst) {
some_big_operations($arrInst->someHugeArray);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment