rfc:empty_isset_exprs

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
rfc:empty_isset_exprs [2012/04/30 12:49] – Change vote nikicrfc:empty_isset_exprs [2012/04/30 13:02] – Add paragraph for only empty() nikic
Line 39: Line 39:
  
 The patch is available as a PR on Github: https://github.com/php/php-src/pull/54 The patch is available as a PR on Github: https://github.com/php/php-src/pull/54
 +
 +==== Change only empty()? ====
 +
 +After further discussion it seems like it might be better to only add expression support for ''empty()'', but not for ''isset()''. The
 +original RFC included ''isset()'', because changing only one of the language constructs seemed inconsistent (as they are so similar).
 +
 +On the other hand, using ''isset()'' on function calls and other expressions doesn't seem particularly useful. ''isset(someFunction())''
 +is semantically unclear (how can ''someFunction()'' not be set?) and could be interpreted as a check whether the function itself exists.
 +
 +Allowing ''isset()'' to accept expressions would probably only cause confusion.
  
 ==== Vote ==== ==== Vote ====
rfc/empty_isset_exprs.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1