3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = "test"; echo array_reduce( str_split($data), fn($sum, $char) => $sum + ord($char) - 96, );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5JqC2
function name:  (null)
number of ops:  11
compiled vars:  !0 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'test'
    4     1        INIT_FCALL                                               'array_reduce'
    5     2        INIT_FCALL                                               'str_split'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $2      
          5        SEND_VAR                                                 $2
    6     6        DECLARE_LAMBDA_FUNCTION                          ~3      [0]
          7        SEND_VAL                                                 ~3
    4     8        DO_ICALL                                         $4      
    6     9        ECHO                                                     $4
    7    10      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5JqC2
function name:  {closure}
number of ops:  9
compiled vars:  !0 = $sum, !1 = $char
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        INIT_FCALL                                               'ord'
          3        SEND_VAR                                                 !1
          4        DO_ICALL                                         $2      
          5        ADD                                              ~3      !0, $2
          6        SUB                                              ~4      ~3, 96
          7      > RETURN                                                   ~4
          8*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
125.66 ms | 999 KiB | 16 Q