3v4l.org

run code in 300+ PHP versions simultaneously
<?php $profiles = [ 'entity_weight_boost' => [ 'score_mode' => 'sum', 'functions' => [ [ // Incoming links: k = 100, since it is normal to have a bunch of incoming links 'type' => 'satu', 'weight' => '0.6', 'params' => [ 'field' => 'incoming_links', 'missing' => 0, 'a' => 1 , 'k' => 100 ] ], [ // Site links: k = 20, tens of sites is a lot 'type' => 'satu', 'weight' => '0.4', 'params' => [ 'field' => 'sitelink_count', 'missing' => 0, 'a' => 2, 'k' => 20 ] ], [ // (De)boosting by statement values 'type' => 'term_boost', 'weight' => 0.1, 'params' => [ 'statement_keywords' => [ // Q4167410=Wikimedia disambiguation page 'P31=Q4167410' => -10, // T183510: // Q13442814=scientific article 'P31=Q13442814' => -5, // Q18918145=academic journal article 'P31=Q18918145' => -5, ] ] ] ], ], ]; $overrides = [ 'entity_weight_boost.functions.2.params.statement_keywords' => 'SomeOverride' ]; function setDotted(array $path, &$arg, $val) { $key = array_shift($path); if (!isset($arg[$key])) { return; } if (count($path) === 0) { $arg[$key] = $val; } else { setDotted($path, $arg[$key], $val); } } foreach ( $overrides as $path => $configVar ) { setDotted(explode(".", $path), $profiles, ['a' => 1]); } var_dump($profiles);
Output for git.master, git.master_jit, rfc.property-hooks
array(1) { ["entity_weight_boost"]=> array(2) { ["score_mode"]=> string(3) "sum" ["functions"]=> array(3) { [0]=> array(3) { ["type"]=> string(4) "satu" ["weight"]=> string(3) "0.6" ["params"]=> array(4) { ["field"]=> string(14) "incoming_links" ["missing"]=> int(0) ["a"]=> int(1) ["k"]=> int(100) } } [1]=> array(3) { ["type"]=> string(4) "satu" ["weight"]=> string(3) "0.4" ["params"]=> array(4) { ["field"]=> string(14) "sitelink_count" ["missing"]=> int(0) ["a"]=> int(2) ["k"]=> int(20) } } [2]=> array(3) { ["type"]=> string(10) "term_boost" ["weight"]=> float(0.1) ["params"]=> array(1) { ["statement_keywords"]=> array(1) { ["a"]=> int(1) } } } } } }

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
51.73 ms | 403 KiB | 8 Q