3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getSomething() { return 'foo'; } $a = getSomething() || 'bar'; $b = getSomething() or 'bar'; echo $a.PHP_EOL; echo $b.PHP_EOL;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 3, Position 2 = 4
Branch analysis from position: 3
2 jumps found. (Code = 47) Position 1 = 9, Position 2 = 10
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
Branch analysis from position: 4
filename:       /in/ZbtES
function name:  (null)
number of ops:  15
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   INIT_FCALL                                               'getsomething'
          1        DO_FCALL                                      0  $2      
          2      > JMPNZ_EX                                         ~3      $2, ->4
          3    >   BOOL                                             ~3      'bar'
          4    >   ASSIGN                                                   !0, ~3
    6     5        INIT_FCALL                                               'getsomething'
          6        DO_FCALL                                      0  $5      
          7        ASSIGN                                           ~6      !1, $5
          8      > JMPNZ_EX                                         ~6      ~6, ->10
          9    >   BOOL                                             ~6      'bar'
    8    10    >   CONCAT                                           ~7      !0, '%0A'
         11        ECHO                                                     ~7
    9    12        CONCAT                                           ~8      !1, '%0A'
         13        ECHO                                                     ~8
         14      > RETURN                                                   1

Function getsomething:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZbtES
function name:  getSomething
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E > > RETURN                                                   'foo'
          1*     > RETURN                                                   null

End of function getsomething

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.36 ms | 1397 KiB | 15 Q