3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class AdminPage { public function __construct($args = []) { $action = isset($args['is_network']) && $args['is_network'] ? 'network_admin_menu' : 'admin_menu'; echo "using $action for " . __CLASS__ . "\r\n"; } } class AdminNetworkPage extends AdminPage { public function __construct($args = []) { $args['is_network'] = true; parent::__construct($args); } } new AdminPage(); new AdminNetworkPage();
based on fOvNa
Output for 5.6.0 - 5.6.30, hhvm-3.18.5 - 3.22.0, 7.0.0 - 7.3.0rc3
using admin_menu for AdminPage using network_admin_menu for AdminPage