3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* if (isset(static::$attrAccessible)) { if (is_array(static::$attrAccessible) && count(static::$attrAccessible) > 0) { $checkArray = array_fill_keys(static::$attrAccessible, 0); $attributes = array_intersect_key($attributes, $checkArray); } } elseif (isset(static::$attrProtected)) { if (is_array(static::$attrProtected) && count(static::$attrProtected) > 0) { $checkArray = array_fill_keys(static::$attrProtected, 0); $attributes = array_diff_key($attributes, $checkArray); } } */ $attrAccessible = array('name', 'age', 'location'); $attributes = array('id', 'name', 'age', 'location', 'updated_at', 'created_at'); $checkArray = array_fill_keys($attrAccessible, 0); $purgedArray = array_diff_key($attributes, $checkArray); echo implode(', ', $attributes); echo "\n"; echo implode(', ', $purgedArray);
Output for git.master, git.master_jit, rfc.property-hooks
id, name, age, location, updated_at, created_at id, name, age, location, updated_at, created_at

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