3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class User { public $address; } class Address { public $street; } function old($key, $default) { var_dump($default); } $address = new Address(); $address->street = 'Street'; $user = new User(); $user->address = $address; old('address', $user->address ?? '');
based on QoFkr
Output for hhvm-3.18.5 - 3.22.0, 7.0.0 - 7.3.0beta1
object(Address)#1 (1) { ["street"]=> string(6) "Street" }
Output for 5.6.0 - 5.6.30
Parse error: syntax error, unexpected '?' in /in/juW1I on line 23
Process exited with code 255.