3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $limit = [null, null]; var_dump(min($limit)); $limit = [null]; var_dump(min($limit)); $limit = [5]; var_dump(min($limit)); $limit = [5, null]; var_dump(min($limit)); $limit = [null, 5]; var_dump(min($limit)); $limit = [null, null]; $limit = array_filter($limit, 'strlen'); var_dump(min($limit)); $limit = [null]; $limit = array_filter($limit, 'strlen'); var_dump(min($limit)); $limit = [5]; $limit = array_filter($limit, 'strlen'); var_dump(min($limit)); $limit = [5, null]; $limit = array_filter($limit, 'strlen'); var_dump(min($limit)); $limit = [null, 5]; $limit = array_filter($limit, 'strlen'); var_dump(min($limit));
Output for 5.4.0 - 7.1.0
NULL NULL int(5) NULL NULL Warning: min(): Array must contain at least one element in /in/dpe8m on line 22 bool(false) Warning: min(): Array must contain at least one element in /in/dpe8m on line 26 bool(false) int(5) int(5) int(5)
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/dpe8m on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected '[' in /in/dpe8m on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/dpe8m on line 3
Process exited with code 255.