3v4l.org

run code in 500+ PHP versions simultaneously
<?php function accountHash($accountNumber) { return array_sum( preg_split('//u', mb_substr($accountNumber, -6), null, PREG_SPLIT_NO_EMPTY) ); } var_dump(accountHash('9876543210')); var_dump(accountHash('321')); var_dump(accountHash('Hello, World!'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GRdGN
function name:  (null)
number of ops:  19
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   10     0  E >   INIT_FCALL                                                   'var_dump'
          1        INIT_FCALL                                                   'accounthash'
          2        SEND_VAL                                                     '9876543210'
          3        DO_FCALL                                          0  $0      
          4        SEND_VAR                                                     $0
          5        DO_ICALL                                                     
   11     6        INIT_FCALL                                                   'var_dump'
          7        INIT_FCALL                                                   'accounthash'
          8        SEND_VAL                                                     '321'
          9        DO_FCALL                                          0  $2      
         10        SEND_VAR                                                     $2
         11        DO_ICALL                                                     
   12    12        INIT_FCALL                                                   'var_dump'
         13        INIT_FCALL                                                   'accounthash'
         14        SEND_VAL                                                     'Hello%2C+World%21'
         15        DO_FCALL                                          0  $4      
         16        SEND_VAR                                                     $4
         17        DO_ICALL                                                     
         18      > RETURN                                                       1

Function accounthash:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GRdGN
function name:  accountHash
number of ops:  16
compiled vars:  !0 = $accountNumber
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   RECV                                                 !0      
    5     1        INIT_FCALL                                                   'array_sum'
    6     2        INIT_FCALL                                                   'preg_split'
          3        SEND_VAL                                                     '%2F%2Fu'
          4        INIT_FCALL                                                   'mb_substr'
          5        SEND_VAR                                                     !0
          6        SEND_VAL                                                     -6
          7        DO_ICALL                                             $1      
          8        SEND_VAR                                                     $1
          9        SEND_VAL                                                     null
         10        SEND_VAL                                                     1
         11        DO_ICALL                                             $2      
         12        SEND_VAR                                                     $2
    5    13        DO_ICALL                                             $3      
    6    14      > RETURN                                                       $3
    8    15*     > RETURN                                                       null

End of function accounthash

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
235.05 ms | 2306 KiB | 20 Q