3v4l.org

run code in 500+ PHP versions simultaneously
<?php $a = 5; $b = $a++-++$a; echo $b; // -2 echo $a; // 7 // This, sadly, doesn't compile //$b = $a+++++$a; $a = 5; $b = $a++ + ++$a; // 12 echo $b; // 12 echo $a; // 7
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lrZe3
function name:  (null)
number of ops:  15
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, 5
    4     1        POST_INC                                             ~3      !0
          2        PRE_INC                                              ~4      !0
          3        SUB                                                  ~5      ~3, ~4
          4        ASSIGN                                                       !1, ~5
    6     5        ECHO                                                         !1
    7     6        ECHO                                                         !0
   12     7        ASSIGN                                                       !0, 5
   13     8        POST_INC                                             ~8      !0
          9        PRE_INC                                              ~9      !0
         10        ADD                                                  ~10     ~8, ~9
         11        ASSIGN                                                       !1, ~10
   14    12        ECHO                                                         !1
   15    13        ECHO                                                         !0
         14      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
131.87 ms | 1109 KiB | 13 Q