3v4l.org

run code in 300+ PHP versions simultaneously
<?php $w="War and 12 Peace3"; for($l=$i=mb_strlen($w);$i--;){ $c=array_sum(unpack("C*",mb_substr($w,$i,1))); 96<$c&&$c<123 and $v+=$c-96 or 64<$c&&$c<91 and $v+=1.5*$c-96 or 48<$c&&$c>32||$c>57&&$c<127 and $v-=1; echo "$v,"; } echo $v/$l,"\n"; preg_match_all("/\d+/",$w,$m);echo array_sum($m[0]); echo PHP_MAX_INT, " ", ~0;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 57
Branch analysis from position: 57
2 jumps found. (Code = 44) Position 1 = 59, Position 2 = 7
Branch analysis from position: 59
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
2 jumps found. (Code = 46) Position 1 = 22, Position 2 = 24
Branch analysis from position: 22
2 jumps found. (Code = 46) Position 1 = 25, Position 2 = 28
Branch analysis from position: 25
2 jumps found. (Code = 47) Position 1 = 29, Position 2 = 39
Branch analysis from position: 29
2 jumps found. (Code = 46) Position 1 = 31, Position 2 = 33
Branch analysis from position: 31
2 jumps found. (Code = 46) Position 1 = 34, Position 2 = 38
Branch analysis from position: 34
2 jumps found. (Code = 47) Position 1 = 40, Position 2 = 54
Branch analysis from position: 40
2 jumps found. (Code = 46) Position 1 = 42, Position 2 = 44
Branch analysis from position: 42
2 jumps found. (Code = 47) Position 1 = 45, Position 2 = 50
Branch analysis from position: 45
2 jumps found. (Code = 46) Position 1 = 47, Position 2 = 49
Branch analysis from position: 47
2 jumps found. (Code = 46) Position 1 = 51, Position 2 = 53
Branch analysis from position: 51
2 jumps found. (Code = 44) Position 1 = 59, Position 2 = 7
Branch analysis from position: 59
Branch analysis from position: 7
Branch analysis from position: 53
Branch analysis from position: 49
Branch analysis from position: 50
Branch analysis from position: 44
Branch analysis from position: 54
Branch analysis from position: 38
Branch analysis from position: 33
Branch analysis from position: 39
Branch analysis from position: 28
Branch analysis from position: 24
filename:       /in/3Iqpk
function name:  (null)
number of ops:  77
compiled vars:  !0 = $w, !1 = $l, !2 = $i, !3 = $c, !4 = $v, !5 = $m
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'War+and+12+Peace3'
    4     1        INIT_FCALL                                               'mb_strlen'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $7      
          4        ASSIGN                                           ~8      !2, $7
          5        ASSIGN                                                   !1, ~8
          6      > JMP                                                      ->57
    5     7    >   INIT_FCALL                                               'array_sum'
          8        INIT_FCALL                                               'unpack'
          9        SEND_VAL                                                 'C%2A'
         10        INIT_FCALL                                               'mb_substr'
         11        SEND_VAR                                                 !0
         12        SEND_VAR                                                 !2
         13        SEND_VAL                                                 1
         14        DO_ICALL                                         $10     
         15        SEND_VAR                                                 $10
         16        DO_ICALL                                         $11     
         17        SEND_VAR                                                 $11
         18        DO_ICALL                                         $12     
         19        ASSIGN                                                   !3, $12
    6    20        IS_SMALLER                                       ~14     96, !3
         21      > JMPZ_EX                                          ~14     ~14, ->24
         22    >   IS_SMALLER                                       ~15     !3, 123
         23        BOOL                                             ~14     ~15
         24    > > JMPZ_EX                                          ~14     ~14, ->28
         25    >   SUB                                              ~16     !3, 96
         26        ASSIGN_OP                                     1  ~17     !4, ~16
         27        BOOL                                             ~14     ~17
         28    > > JMPNZ_EX                                         ~14     ~14, ->39
         29    >   IS_SMALLER                                       ~18     64, !3
         30      > JMPZ_EX                                          ~18     ~18, ->33
         31    >   IS_SMALLER                                       ~19     !3, 91
         32        BOOL                                             ~18     ~19
         33    > > JMPZ_EX                                          ~18     ~18, ->38
         34    >   MUL                                              ~20     !3, 1.5
         35        SUB                                              ~21     ~20, 96
         36        ASSIGN_OP                                     1  ~22     !4, ~21
         37        BOOL                                             ~18     ~22
         38    >   BOOL                                             ~14     ~18
         39    > > JMPNZ_EX                                         ~14     ~14, ->54
         40    >   IS_SMALLER                                       ~23     48, !3
         41      > JMPZ_EX                                          ~23     ~23, ->44
         42    >   IS_SMALLER                                       ~24     32, !3
         43        BOOL                                             ~23     ~24
         44    > > JMPNZ_EX                                         ~23     ~23, ->50
         45    >   IS_SMALLER                                       ~25     57, !3
         46      > JMPZ_EX                                          ~25     ~25, ->49
         47    >   IS_SMALLER                                       ~26     !3, 127
         48        BOOL                                             ~25     ~26
         49    >   BOOL                                             ~23     ~25
         50    > > JMPZ_EX                                          ~23     ~23, ->53
         51    >   ASSIGN_OP                                     2  ~27     !4, 1
         52        BOOL                                             ~23     ~27
         53    >   BOOL                                             ~14     ~23
    7    54    >   NOP                                                      
         55        FAST_CONCAT                                      ~28     !4, '%2C'
         56        ECHO                                                     ~28
    4    57    >   POST_DEC                                         ~29     !2
         58      > JMPNZ                                                    ~29, ->7
    9    59    >   DIV                                              ~30     !4, !1
         60        ECHO                                                     ~30
         61        ECHO                                                     '%0A'
   10    62        INIT_FCALL                                               'preg_match_all'
         63        SEND_VAL                                                 '%2F%5Cd%2B%2F'
         64        SEND_VAR                                                 !0
         65        SEND_REF                                                 !5
         66        DO_ICALL                                                 
         67        INIT_FCALL                                               'array_sum'
         68        FETCH_DIM_R                                      ~32     !5, 0
         69        SEND_VAL                                                 ~32
         70        DO_ICALL                                         $33     
         71        ECHO                                                     $33
   12    72        FETCH_CONSTANT                                   ~34     'PHP_MAX_INT'
         73        ECHO                                                     ~34
         74        ECHO                                                     '+'
         75        ECHO                                                     -1
         76      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
183.28 ms | 1404 KiB | 23 Q