3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo() { $a = 0; $b = &$a; echo ++$a + $a++; } function bar() { $a = 0; echo ++$a + $a++; } foo(); // 3 bar(); // 2
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hjqBd
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_FCALL                                               'foo'
          1        DO_FCALL                                      0          
   14     2        INIT_FCALL                                               'bar'
          3        DO_FCALL                                      0          
          4      > RETURN                                                   1

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hjqBd
function name:  foo
number of ops:  7
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 0
    4     1        ASSIGN_REF                                               !1, !0
    5     2        PRE_INC                                          ~4      !0
          3        POST_INC                                         ~5      !0
          4        ADD                                              ~6      ~4, ~5
          5        ECHO                                                     ~6
    6     6      > RETURN                                                   null

End of function foo

Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hjqBd
function name:  bar
number of ops:  6
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ASSIGN                                                   !0, 0
   10     1        PRE_INC                                          ~2      !0
          2        POST_INC                                         ~3      !0
          3        ADD                                              ~4      ~2, ~3
          4        ECHO                                                     ~4
   11     5      > RETURN                                                   null

End of function bar

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.68 ms | 1398 KiB | 15 Q