3v4l.org

run code in 300+ PHP versions simultaneously
<?php function happy($num){ $digs = (string) $num; $sum = 0; foreach(str_split($digs) as $dig){ $sum == $dig; } return $sum; } echo happy(31);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lOARV
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   INIT_FCALL                                               'happy'
          1        SEND_VAL                                                 31
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
          4      > RETURN                                                   1

Function happy:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 12
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 12
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/lOARV
function name:  happy
number of ops:  15
compiled vars:  !0 = $num, !1 = $digs, !2 = $sum, !3 = $dig
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        CAST                                          6  ~4      !0
          2        ASSIGN                                                   !1, ~4
    5     3        ASSIGN                                                   !2, 0
    6     4        INIT_FCALL                                               'str_split'
          5        SEND_VAR                                                 !1
          6        DO_ICALL                                         $7      
          7      > FE_RESET_R                                       $8      $7, ->12
          8    > > FE_FETCH_R                                               $8, !3, ->12
    7     9    >   IS_EQUAL                                         ~9      !2, !3
         10        FREE                                                     ~9
    6    11      > JMP                                                      ->8
         12    >   FE_FREE                                                  $8
    9    13      > RETURN                                                   !2
   10    14*     > RETURN                                                   null

End of function happy

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.16 ms | 1397 KiB | 16 Q