3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function somefunc() { return 'somestring'; } ob_start(); $time = microtime(1); $i = 0; while($i++ < 1000000) echo'somestring',somefunc(),'somestring'; ob_end_clean(); echo (microtime(1)-$time)." seconds for commas"; echo "\n"; ob_start(); $time = microtime(1); $i = 0; while($i++ < 1000000) echo'somestring'.somefunc().'somestring'; ob_end_clean(); echo (microtime(1)-$time)." seconds for dot";
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = 14
Branch analysis from position: 14
Jump found. Position 1 = 17, Position 2 = 9
Branch analysis from position: 17
Jump found. Position 1 = 39
Branch analysis from position: 39
Jump found. Position 1 = 42, Position 2 = 34
Branch analysis from position: 42
Jump found. Position 1 = -2
Branch analysis from position: 34
Jump found. Position 1 = 42, Position 2 = 34
Branch analysis from position: 42
Branch analysis from position: 34
Branch analysis from position: 9
Jump found. Position 1 = 17, Position 2 = 9
Branch analysis from position: 17
Branch analysis from position: 9
filename:       /in/3af31
function name:  (null)
number of ops:  51
compiled vars:  !0 = $time, !1 = $i
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   NOP                                                      
   5     1        INIT_FCALL                                               'ob_start'
         2        DO_ICALL                                                 
   6     3        INIT_FCALL                                               'microtime'
         4        SEND_VAL                                                 1
         5        DO_ICALL                                         $3      
         6        ASSIGN                                                   !0, $3
   7     7        ASSIGN                                                   !1, 0
   8     8      > JMP                                                      ->14
         9    >   ECHO                                                     'somestring'
        10        INIT_FCALL                                               'somefunc'
        11        DO_FCALL                                      0  $6      
        12        ECHO                                                     $6
        13        ECHO                                                     'somestring'
        14    >   POST_INC                                         ~7      !1
        15        IS_SMALLER                                       ~8      ~7, 1000000
        16      > JMPNZ                                                    ~8, ->9
   9    17    >   INIT_FCALL                                               'ob_end_clean'
        18        DO_ICALL                                                 
  10    19        INIT_FCALL                                               'microtime'
        20        SEND_VAL                                                 1
        21        DO_ICALL                                         $10     
        22        SUB                                              ~11     $10, !0
        23        CONCAT                                           ~12     ~11, '+seconds+for+commas'
        24        ECHO                                                     ~12
  12    25        ECHO                                                     '%0A'
  14    26        INIT_FCALL                                               'ob_start'
        27        DO_ICALL                                                 
  15    28        INIT_FCALL                                               'microtime'
        29        SEND_VAL                                                 1
        30        DO_ICALL                                         $14     
        31        ASSIGN                                                   !0, $14
  16    32        ASSIGN                                                   !1, 0
  17    33      > JMP                                                      ->39
        34    >   INIT_FCALL                                               'somefunc'
        35        DO_FCALL                                      0  $17     
        36        CONCAT                                           ~18     'somestring', $17
        37        CONCAT                                           ~19     ~18, 'somestring'
        38        ECHO                                                     ~19
        39    >   POST_INC                                         ~20     !1
        40        IS_SMALLER                                       ~21     ~20, 1000000
        41      > JMPNZ                                                    ~21, ->34
  18    42    >   INIT_FCALL                                               'ob_end_clean'
        43        DO_ICALL                                                 
  19    44        INIT_FCALL                                               'microtime'
        45        SEND_VAL                                                 1
        46        DO_ICALL                                         $23     
        47        SUB                                              ~24     $23, !0
        48        CONCAT                                           ~25     ~24, '+seconds+for+dot'
        49        ECHO                                                     ~25
        50      > RETURN                                                   1

Function somefunc:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/3af31
function name:  somefunc
number of ops:  2
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E > > RETURN                                                   'somestring'
         1*     > RETURN                                                   null

End of function somefunc

Generated using Vulcan Logic Dumper, using php 7.2.0