Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: ec061a93c5
Fetching contributors…

Cannot retrieve contributors at this time

33 lines (27 sloc) 0.554 kB
--TEST--
empty() with arbitrary expressions
--FILE--
<?php
function getEmptyArray() { return []; }
function getNonEmptyArray() { return [1, 2, 3]; }
var_dump(empty([]));
var_dump(empty([1, 2, 3]));
var_dump(empty(getEmptyArray()));
var_dump(empty(getNonEmptyArray()));
var_dump(empty([] + []));
var_dump(empty([1, 2, 3] + []));
var_dump(empty("string"));
var_dump(empty(""));
var_dump(empty(true));
var_dump(empty(false));
--EXPECT--
bool(true)
bool(false)
bool(true)
bool(false)
bool(true)
bool(false)
bool(false)
bool(true)
bool(false)
bool(true)
Jump to Line
Something went wrong with that request. Please try again.