3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = 1; $b = 2; $c = 0; $d = $e = $f = -1; if ( $d = $c && $e = $b && $f = $a ) { echo "yes"; } var_dump($d, $e, $f); // Why isn't this a parse error?? It doesn't do: // $d = ($c && $e) = ($b && $f) = $a // (because that is a parse error on its own) // So what does it do?? echo "\n\n"; $d = $e = $f = -1; if ( $d = $c and $e = $b and $f = $a ) { echo "yes"; } var_dump($d, $e, $f); // ($d = $c) && ($e = $b) && ($f = $a) so only $d=$c is executed, bc $c is falsy echo "\n\n"; $d = $e = $f = -1; if ( $d = $a and $e = $b and $f = $c ) { echo "yes"; } var_dump($d, $e, $f); // ($d = $a) && ($e = $b) && ($f = $c) and all 3 are executed, bc first 2 are truthy
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 7, Position 2 = 12
Branch analysis from position: 7
2 jumps found. (Code = 46) Position 1 = 8, Position 2 = 10
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 15
Branch analysis from position: 14
2 jumps found. (Code = 46) Position 1 = 26, Position 2 = 28
Branch analysis from position: 26
2 jumps found. (Code = 46) Position 1 = 29, Position 2 = 31
Branch analysis from position: 29
2 jumps found. (Code = 43) Position 1 = 32, Position 2 = 33
Branch analysis from position: 32
2 jumps found. (Code = 46) Position 1 = 44, Position 2 = 46
Branch analysis from position: 44
2 jumps found. (Code = 46) Position 1 = 47, Position 2 = 49
Branch analysis from position: 47
2 jumps found. (Code = 43) Position 1 = 50, Position 2 = 51
Branch analysis from position: 50
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 51
Branch analysis from position: 49
Branch analysis from position: 46
Branch analysis from position: 33
Branch analysis from position: 31
Branch analysis from position: 28
Branch analysis from position: 15
Branch analysis from position: 10
Branch analysis from position: 12
filename:       /in/3P2hN
function name:  (null)
number of ops:  57
compiled vars:  !0 = $a, !1 = $b, !2 = $c, !3 = $d, !4 = $e, !5 = $f
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 1
    4     1        ASSIGN                                                   !1, 2
    5     2        ASSIGN                                                   !2, 0
    7     3        ASSIGN                                           ~9      !5, -1
          4        ASSIGN                                           ~10     !4, ~9
          5        ASSIGN                                                   !3, ~10
    8     6      > JMPZ_EX                                          ~12     !2, ->12
          7    > > JMPZ_EX                                          ~13     !1, ->10
          8    >   ASSIGN                                           ~14     !5, !0
          9        BOOL                                             ~13     ~14
         10    >   ASSIGN                                           ~15     !4, ~13
         11        BOOL                                             ~12     ~15
         12    >   ASSIGN                                           ~16     !3, ~12
         13      > JMPZ                                                     ~16, ->15
    9    14    >   ECHO                                                     'yes'
   12    15    >   INIT_FCALL                                               'var_dump'
         16        SEND_VAR                                                 !3
         17        SEND_VAR                                                 !4
         18        SEND_VAR                                                 !5
         19        DO_ICALL                                                 
   18    20        ECHO                                                     '%0A%0A'
   20    21        ASSIGN                                           ~18     !5, -1
         22        ASSIGN                                           ~19     !4, ~18
         23        ASSIGN                                                   !3, ~19
   21    24        ASSIGN                                           ~21     !3, !2
         25      > JMPZ_EX                                          ~21     ~21, ->28
         26    >   ASSIGN                                           ~22     !4, !1
         27        BOOL                                             ~21     ~22
         28    > > JMPZ_EX                                          ~21     ~21, ->31
         29    >   ASSIGN                                           ~23     !5, !0
         30        BOOL                                             ~21     ~23
         31    > > JMPZ                                                     ~21, ->33
   22    32    >   ECHO                                                     'yes'
   25    33    >   INIT_FCALL                                               'var_dump'
         34        SEND_VAR                                                 !3
         35        SEND_VAR                                                 !4
         36        SEND_VAR                                                 !5
         37        DO_ICALL                                                 
   28    38        ECHO                                                     '%0A%0A'
   30    39        ASSIGN                                           ~25     !5, -1
         40        ASSIGN                                           ~26     !4, ~25
         41        ASSIGN                                                   !3, ~26
   31    42        ASSIGN                                           ~28     !3, !0
         43      > JMPZ_EX                                          ~28     ~28, ->46
         44    >   ASSIGN                                           ~29     !4, !1
         45        BOOL                                             ~28     ~29
         46    > > JMPZ_EX                                          ~28     ~28, ->49
         47    >   ASSIGN                                           ~30     !5, !2
         48        BOOL                                             ~28     ~30
         49    > > JMPZ                                                     ~28, ->51
   32    50    >   ECHO                                                     'yes'
   35    51    >   INIT_FCALL                                               'var_dump'
         52        SEND_VAR                                                 !3
         53        SEND_VAR                                                 !4
         54        SEND_VAR                                                 !5
         55        DO_ICALL                                                 
   36    56      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.2 ms | 1445 KiB | 15 Q