3v4l.org

run code in 300+ PHP versions simultaneously
<?php fscanf(STDIN, "%d", $n); $c = 0; $array = []; for($i=1;$i<=1000000000;$i++) { $c += substr_count($i, 1); $array[$i] = $c; } var_dump($array); echo $c . "\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 10
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 10
Branch analysis from position: 20
Branch analysis from position: 10
filename:       /in/idD0R
function name:  (null)
number of ops:  26
compiled vars:  !0 = $n, !1 = $c, !2 = $array, !3 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'fscanf'
          1        FETCH_CONSTANT                                   ~4      'STDIN'
          2        SEND_VAL                                                 ~4
          3        SEND_VAL                                                 '%25d'
          4        SEND_REF                                                 !0
          5        DO_ICALL                                                 
    3     6        ASSIGN                                                   !1, 0
    4     7        ASSIGN                                                   !2, <array>
    5     8        ASSIGN                                                   !3, 1
          9      > JMP                                                      ->18
    6    10    >   INIT_FCALL                                               'substr_count'
         11        SEND_VAR                                                 !3
         12        SEND_VAL                                                 1
         13        DO_ICALL                                         $9      
         14        ASSIGN_OP                                     1          !1, $9
    7    15        ASSIGN_DIM                                               !2, !3
         16        OP_DATA                                                  !1
    5    17        PRE_INC                                                  !3
         18    >   IS_SMALLER_OR_EQUAL                                      !3, 1000000000
         19      > JMPNZ                                                    ~13, ->10
    9    20    >   INIT_FCALL                                               'var_dump'
         21        SEND_VAR                                                 !2
         22        DO_ICALL                                                 
   10    23        CONCAT                                           ~15     !1, '%0A'
         24        ECHO                                                     ~15
         25      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.4 ms | 1395 KiB | 19 Q