3v4l.org

run code in 300+ PHP versions simultaneously
<?php function by_ref (&$ref) { $ref = 42; } function by_handle ($handle) { $handle = 42; } $thing1 = new class {}; $thing2 = new class {}; by_ref($thing1); by_handle($thing2); var_dump($thing1, $thing2);

preferences:
25.77 ms | 402 KiB | 5 Q