3v4l.org

run code in 300+ PHP versions simultaneously
<?php $expr1 = null; $expr2 = 'expr2'; $expr3 = 'expr3'; $result = ($expr1) ? ($expr2) : ($expr3); var_dump($result); if (true === $expr1) { $result = $expr2; } else { $result = $expr3; } var_dump($result); $result = ($expr1) ?: ($expr3); var_dump($result); if (true === $expr1) { $result = $expr1; } else { $result = $expr3; } var_dump($result); $result = ($expr1) ?? ($expr3); var_dump($result); if (null !== $expr1) { $result = $expr1; } else { $result = $expr3; } var_dump($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 15
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 27, Position 2 = 29
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
2 jumps found. (Code = 43) Position 1 = 41, Position 2 = 43
Branch analysis from position: 41
1 jumps found. (Code = 42) Position 1 = 44
Branch analysis from position: 44
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 43
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 29
2 jumps found. (Code = 43) Position 1 = 41, Position 2 = 43
Branch analysis from position: 41
Branch analysis from position: 43
Branch analysis from position: 15
2 jumps found. (Code = 43) Position 1 = 27, Position 2 = 29
Branch analysis from position: 27
Branch analysis from position: 29
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 15
Branch analysis from position: 13
Branch analysis from position: 15
filename:       /in/SWfOt
function name:  (null)
number of ops:  48
compiled vars:  !0 = $expr1, !1 = $expr2, !2 = $expr3, !3 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, null
    4     1        ASSIGN                                                   !1, 'expr2'
    5     2        ASSIGN                                                   !2, 'expr3'
    7     3      > JMPZ                                                     !0, ->6
          4    >   QM_ASSIGN                                        ~7      !1
          5      > JMP                                                      ->7
          6    >   QM_ASSIGN                                        ~7      !2
          7    >   ASSIGN                                                   !3, ~7
    9     8        INIT_FCALL                                               'var_dump'
          9        SEND_VAR                                                 !3
         10        DO_ICALL                                                 
   11    11        TYPE_CHECK                                    8          !0
         12      > JMPZ                                                     ~10, ->15
   12    13    >   ASSIGN                                                   !3, !1
   11    14      > JMP                                                      ->16
   14    15    >   ASSIGN                                                   !3, !2
   17    16    >   INIT_FCALL                                               'var_dump'
         17        SEND_VAR                                                 !3
         18        DO_ICALL                                                 
   19    19        JMP_SET                                          ~14     !0, ->21
         20        QM_ASSIGN                                        ~14     !2
         21        ASSIGN                                                   !3, ~14
   21    22        INIT_FCALL                                               'var_dump'
         23        SEND_VAR                                                 !3
         24        DO_ICALL                                                 
   23    25        TYPE_CHECK                                    8          !0
         26      > JMPZ                                                     ~17, ->29
   24    27    >   ASSIGN                                                   !3, !0
   23    28      > JMP                                                      ->30
   26    29    >   ASSIGN                                                   !3, !2
   29    30    >   INIT_FCALL                                               'var_dump'
         31        SEND_VAR                                                 !3
         32        DO_ICALL                                                 
   31    33        COALESCE                                         ~21     !0
         34        QM_ASSIGN                                        ~21     !2
         35        ASSIGN                                                   !3, ~21
   33    36        INIT_FCALL                                               'var_dump'
         37        SEND_VAR                                                 !3
         38        DO_ICALL                                                 
   35    39        TYPE_CHECK                                  1020          !0
         40      > JMPZ                                                     ~24, ->43
   36    41    >   ASSIGN                                                   !3, !0
   35    42      > JMP                                                      ->44
   38    43    >   ASSIGN                                                   !3, !2
   41    44    >   INIT_FCALL                                               'var_dump'
         45        SEND_VAR                                                 !3
         46        DO_ICALL                                                 
         47      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
179.38 ms | 1450 KiB | 14 Q