3v4l.org

run code in 300+ PHP versions simultaneously
<?php $fields = ['value' => 0, 'value' => 0, 'value' => 0]; $empty = function(array $fields) { foreach($fields as $field) { if (empty($field['value'])) { return false; } } }; $greatterThan = function(array $fields) { foreach($fields as $field) { if ($field['value'] >= 1) { return false; } } }; $validAll = function($fields) use ($empty, $greatterThan) { if (!$empty($fields)) { return "invalid some one is empty\n"; } if (!$greatterThan($fields)) { return "invalid some one is les then 1\n"; } }; var_dump($validAll($fields));
Output for git.master, git.master_jit, rfc.property-hooks
string(26) "invalid some one is empty "

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