Review main Merged

42891[BUGFIX] Fix incorrect usage of nested ternary

Markus Klein CR +2 V +2 Easy +4 −4 updated 09/04/15, 10:40

Commit message

Ternaries are left associative in PHP, hence
$a ?: $b ?: $c  ===  ($a ?: $b) ?: $c  !==  $a ?: ($b ?: $c)

Mostly the latter case is used, hence we need parenthesis.

regex used to find occurrences:
^.+?[\s\n]+\?[^\:]*:[\s\n]+.+?[\s\n]+\?.+;$

Review

  • Code review CR +2
    • Alexander Opitz +2
    • Daniel Goerz +1
    • Stephan Großberndt +1
    • Wouter Wolters +1
  • Verified V +2
    • Alexander Opitz +2
    • Wouter Wolters +1

Issues 1

Files 4

Review log 10

  1. Markus Klein uploaded patch set 1 08/27/15, 16:10

  2. Stephan Großberndt voted on patch set 1 CR +1 08/27/15, 16:11

  3. Markus Klein updated the commit message in patch set 2 08/27/15, 16:14

  4. Markus Klein updated the commit message in patch set 3 08/28/15, 12:17

  5. Daniel Goerz voted on patch set 3 CR +1 08/28/15, 12:30

  6. Stephan Großberndt voted on patch set 3 CR +1 08/28/15, 12:39

  7. Wouter Wolters voted on patch set 3 V +1 CR +1 08/28/15, 18:36

  8. Alexander Opitz voted on patch set 3 V +2 CR +2 09/04/15, 08:12

  9. Alexander Opitz merged patch set 3 09/04/15, 08:12

  10. Markus Klein commented on patch set 4 09/04/15, 10:40

    I checked 6.2 now. All this code was introduced with 7 and there were no occurrences in the old code. So no backport necessary.