3v4l.org

run code in 300+ PHP versions simultaneously
<?php $fiels = ['value' => 1, 'value' => 1, 'value' => null]; $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($fiels) use ($empty, $greatterThan) { if (!$empty($fields)) { echo 'invalid some one is empty'; } if (!$empty($fields)) { echo 'invalid some one is les then 1'; } }; var_dump($validAll($fields));
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Undefined variable $fields in /in/XjhPvS on line 32 Warning: Undefined variable $fields in /in/XjhPvS on line 22 Fatal error: Uncaught TypeError: {closure}(): Argument #1 ($fields) must be of type array, null given, called in /in/XjhPvS on line 22 and defined in /in/XjhPvS:5 Stack trace: #0 /in/XjhPvS(22): {closure}(NULL) #1 /in/XjhPvS(32): {closure}(NULL) #2 {main} thrown in /in/XjhPvS on line 5
Process exited with code 255.

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