3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { public function getAssociations(array $including = null, array $types = ['hasOne', 'belongsTo', 'hasMany', 'hasAndBelongsToMany']) { // Associations do not store any state, only instanciate once per model base class static $associations = []; $result = []; foreach ($types as $type) { foreach ($this->{$type} as $name => $properties) { if ($including !== null and !isset($including[$name]) and !in_array($name, $including, true)) { continue; } if (!isset($associations[$name])) { $class = 'Model_Association_' . ucfirst($type); $associations[$name] = new $class( $this, $name, $properties ); } $result[$name] = $associations[$name]; } } return $result; } } ?>
Output for git.master, git.master_jit, rfc.property-hooks

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:
40.85 ms | 401 KiB | 8 Q