3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getNumbers($count) { $numbers = range(1, $count); shuffle($numbers); return $numbers; } function sumOfRemaindersOriginal($numbers) { $resSum = 0; $len = count($numbers); if($len == 1) return 0; for($i=0; $i<$len; $i++) for($j=0; $j<$len; $j++) $resSum += $numbers[$i]%$numbers[$j]; return $resSum; } print sumOfRemaindersOriginal( getNumbers(5000) );

Abusive script

This script was stopped while abusing our resources

Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cpLd5
function name:  (null)
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   INIT_FCALL                                               'sumofremaindersoriginal'
          1        INIT_FCALL                                               'getnumbers'
          2        SEND_VAL                                                 5000
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        DO_FCALL                                      0  $1      
          6        ECHO                                                     $1
          7      > RETURN                                                   1

Function getnumbers:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cpLd5
function name:  getNumbers
number of ops:  11
compiled vars:  !0 = $count, !1 = $numbers
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'range'
          2        SEND_VAL                                                 1
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $2      
          5        ASSIGN                                                   !1, $2
    5     6        INIT_FCALL                                               'shuffle'
          7        SEND_REF                                                 !1
          8        DO_ICALL                                                 
    6     9      > RETURN                                                   !1
    7    10*     > RETURN                                                   null

End of function getnumbers

Function sumofremaindersoriginal:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 7
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 9
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 11
Branch analysis from position: 18
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 9
Branch analysis from position: 21
Branch analysis from position: 9
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 11
Branch analysis from position: 18
Branch analysis from position: 11
filename:       /in/cpLd5
function name:  sumOfRemaindersOriginal
number of ops:  23
compiled vars:  !0 = $numbers, !1 = $resSum, !2 = $len, !3 = $i, !4 = $j
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
   10     1        ASSIGN                                                   !1, 0
   11     2        COUNT                                            ~6      !0
          3        ASSIGN                                                   !2, ~6
   13     4        IS_EQUAL                                                 !2, 1
          5      > JMPZ                                                     ~8, ->7
   14     6    > > RETURN                                                   0
   16     7    >   ASSIGN                                                   !3, 0
          8      > JMP                                                      ->19
   17     9    >   ASSIGN                                                   !4, 0
         10      > JMP                                                      ->16
   18    11    >   FETCH_DIM_R                                      ~11     !0, !3
         12        FETCH_DIM_R                                      ~12     !0, !4
         13        MOD                                              ~13     ~11, ~12
         14        ASSIGN_OP                                     1          !1, ~13
   17    15        PRE_INC                                                  !4
         16    >   IS_SMALLER                                               !4, !2
         17      > JMPNZ                                                    ~16, ->11
   16    18    >   PRE_INC                                                  !3
         19    >   IS_SMALLER                                               !3, !2
         20      > JMPNZ                                                    ~18, ->9
   19    21    > > RETURN                                                   !1
   20    22*     > RETURN                                                   null

End of function sumofremaindersoriginal

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.77 ms | 1008 KiB | 17 Q