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 "\$attrAccessible:" . implode(', ', $attrAccessible); echo "\n"; echo "\$attributes:" .implode(', ', $attributes); echo "\n"; echo "\$checkArray:" .implode(', ', $checkArray); echo "\n"; echo "\$purgedArray:" .implode(', ', $purgedArray);
Output for git.master, git.master_jit, rfc.property-hooks
$attrAccessible:name, age, location $attributes:id, name, age, location, updated_at, created_at $checkArray:0, 0, 0 $purgedArray: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:
54.43 ms | 401 KiB | 8 Q