3v4l.org

run code in 300+ PHP versions simultaneously
<?php $in = 8; $count = 0; function trace($x, $y, $z, $steps) { global $count; if ($steps == 0) { if ($x == 0 && $y == 0 && $z == 0) { $count++; } return; } for($i = $x-1; $i <= $x+1; $i++) { for($j = $y-1; $j <= $y+1; $j++) { for($k = $z-1; $k <= $z+1; $k++) { if ( array_sum(array($i, $j, $k)) !== 0 || ($i == $x && $j == $y && $k == $z) ) { continue; } trace($i, $j, $k, $steps-1); } } } } trace(0, 0, 0, $in); echo $count;

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/P1Rvd
function name:  (null)
number of ops:  10
compiled vars:  !0 = $in, !1 = $count
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 8
    4     1        ASSIGN                                                   !1, 0
   29     2        INIT_FCALL                                               'trace'
          3        SEND_VAL                                                 0
          4        SEND_VAL                                                 0
          5        SEND_VAL                                                 0
          6        SEND_VAR                                                 !0
          7        DO_FCALL                                      0          
   30     8        ECHO                                                     !1
          9      > RETURN                                                   1

Function trace:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 17
Branch analysis from position: 7
2 jumps found. (Code = 46) Position 1 = 9, Position 2 = 11
Branch analysis from position: 9
2 jumps found. (Code = 46) Position 1 = 12, Position 2 = 14
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 16
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
Branch analysis from position: 14
Branch analysis from position: 11
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 60
Branch analysis from position: 60
2 jumps found. (Code = 44) Position 1 = 63, Position 2 = 20
Branch analysis from position: 63
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 56
Branch analysis from position: 56
2 jumps found. (Code = 44) Position 1 = 59, Position 2 = 23
Branch analysis from position: 59
2 jumps found. (Code = 44) Position 1 = 63, Position 2 = 20
Branch analysis from position: 63
Branch analysis from position: 20
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 52
Branch analysis from position: 52
2 jumps found. (Code = 44) Position 1 = 55, Position 2 = 26
Branch analysis from position: 55
2 jumps found. (Code = 44) Position 1 = 59, Position 2 = 23
Branch analysis from position: 59
Branch analysis from position: 23
Branch analysis from position: 26
2 jumps found. (Code = 47) Position 1 = 34, Position 2 = 42
Branch analysis from position: 34
2 jumps found. (Code = 46) Position 1 = 36, Position 2 = 38
Branch analysis from position: 36
2 jumps found. (Code = 46) Position 1 = 39, Position 2 = 41
Branch analysis from position: 39
2 jumps found. (Code = 43) Position 1 = 43, Position 2 = 44
Branch analysis from position: 43
1 jumps found. (Code = 42) Position 1 = 51
Branch analysis from position: 51
2 jumps found. (Code = 44) Position 1 = 55, Position 2 = 26
Branch analysis from position: 55
Branch analysis from position: 26
Branch analysis from position: 44
2 jumps found. (Code = 44) Position 1 = 55, Position 2 = 26
Branch analysis from position: 55
Branch analysis from position: 26
Branch analysis from position: 41
Branch analysis from position: 38
Branch analysis from position: 42
filename:       /in/P1Rvd
function name:  trace
number of ops:  64
compiled vars:  !0 = $x, !1 = $y, !2 = $z, !3 = $steps, !4 = $count, !5 = $i, !6 = $j, !7 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV                                             !3      
    7     4        BIND_GLOBAL                                              !4, 'count'
    8     5        IS_EQUAL                                                 !3, 0
          6      > JMPZ                                                     ~8, ->17
    9     7    >   IS_EQUAL                                         ~9      !0, 0
          8      > JMPZ_EX                                          ~9      ~9, ->11
          9    >   IS_EQUAL                                         ~10     !1, 0
         10        BOOL                                             ~9      ~10
         11    > > JMPZ_EX                                          ~9      ~9, ->14
         12    >   IS_EQUAL                                         ~11     !2, 0
         13        BOOL                                             ~9      ~11
         14    > > JMPZ                                                     ~9, ->16
   10    15    >   PRE_INC                                                  !4
   12    16    > > RETURN                                                   null
   14    17    >   SUB                                              ~13     !0, 1
         18        ASSIGN                                                   !5, ~13
         19      > JMP                                                      ->60
   15    20    >   SUB                                              ~15     !1, 1
         21        ASSIGN                                                   !6, ~15
         22      > JMP                                                      ->56
   16    23    >   SUB                                              ~17     !2, 1
         24        ASSIGN                                                   !7, ~17
         25      > JMP                                                      ->52
   18    26    >   INIT_FCALL                                               'array_sum'
         27        INIT_ARRAY                                       ~19     !5
         28        ADD_ARRAY_ELEMENT                                ~19     !6
         29        ADD_ARRAY_ELEMENT                                ~19     !7
         30        SEND_VAL                                                 ~19
         31        DO_ICALL                                         $20     
         32        IS_NOT_IDENTICAL                                 ~21     $20, 0
         33      > JMPNZ_EX                                         ~21     ~21, ->42
   19    34    >   IS_EQUAL                                         ~22     !5, !0
         35      > JMPZ_EX                                          ~22     ~22, ->38
         36    >   IS_EQUAL                                         ~23     !6, !1
         37        BOOL                                             ~22     ~23
         38    > > JMPZ_EX                                          ~22     ~22, ->41
         39    >   IS_EQUAL                                         ~24     !7, !2
         40        BOOL                                             ~22     ~24
         41    >   BOOL                                             ~21     ~22
         42    > > JMPZ                                                     ~21, ->44
   21    43    > > JMP                                                      ->51
   23    44    >   INIT_FCALL_BY_NAME                                       'trace'
         45        SEND_VAR_EX                                              !5
         46        SEND_VAR_EX                                              !6
         47        SEND_VAR_EX                                              !7
         48        SUB                                              ~25     !3, 1
         49        SEND_VAL_EX                                              ~25
         50        DO_FCALL                                      0          
   16    51    >   PRE_INC                                                  !7
         52    >   ADD                                              ~28     !2, 1
         53        IS_SMALLER_OR_EQUAL                                      !7, ~28
         54      > JMPNZ                                                    ~29, ->26
   15    55    >   PRE_INC                                                  !6
         56    >   ADD                                              ~31     !1, 1
         57        IS_SMALLER_OR_EQUAL                                      !6, ~31
         58      > JMPNZ                                                    ~32, ->23
   14    59    >   PRE_INC                                                  !5
         60    >   ADD                                              ~34     !0, 1
         61        IS_SMALLER_OR_EQUAL                                      !5, ~34
         62      > JMPNZ                                                    ~35, ->20
   27    63    > > RETURN                                                   null

End of function trace

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.98 ms | 1011 KiB | 15 Q