3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * Sum byte values from $start of $str **/ function sum($str, $start) { $sum = 0; $i = $start; for ( $max = strlen($str); $i < $max; ++$i) { $sum += ord($str[$i]); } return $sum; } $str = 'hello world'; echo sum($str, strpos($str, ' '));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6IN3B
function name:  (null)
number of ops:  11
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   ASSIGN                                                   !0, 'hello+world'
   16     1        INIT_FCALL                                               'sum'
          2        SEND_VAR                                                 !0
          3        INIT_FCALL                                               'strpos'
          4        SEND_VAR                                                 !0
          5        SEND_VAL                                                 '+'
          6        DO_ICALL                                         $2      
          7        SEND_VAR                                                 $2
          8        DO_FCALL                                      0  $3      
          9        ECHO                                                     $3
         10      > RETURN                                                   1

Function sum:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 15, Position 2 = 7
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 15, Position 2 = 7
Branch analysis from position: 15
Branch analysis from position: 7
filename:       /in/6IN3B
function name:  sum
number of ops:  17
compiled vars:  !0 = $str, !1 = $start, !2 = $sum, !3 = $i, !4 = $max
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    7     2        ASSIGN                                                   !2, 0
    8     3        ASSIGN                                                   !3, !1
    9     4        STRLEN                                           ~7      !0
          5        ASSIGN                                                   !4, ~7
          6      > JMP                                                      ->13
   10     7    >   INIT_FCALL                                               'ord'
          8        FETCH_DIM_R                                      ~9      !0, !3
          9        SEND_VAL                                                 ~9
         10        DO_ICALL                                         $10     
         11        ASSIGN_OP                                     1          !2, $10
    9    12        PRE_INC                                                  !3
         13    >   IS_SMALLER                                               !3, !4
         14      > JMPNZ                                                    ~13, ->7
   12    15    > > RETURN                                                   !2
   13    16*     > RETURN                                                   null

End of function sum

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.13 ms | 1399 KiB | 18 Q