3v4l.org

run code in 300+ PHP versions simultaneously
<?php function calculate($N) { $count = 0; $i = 1; while ($count <= $N) { if (isPrime($i)) { echo ("$i is prime\n"); $count++; } if ($count === $N) { echo $i . "\n"; break; } $i++; } } function isPrime($n) { for ($i = 2; $i < $n; $i++) { if ($n%$i === 0) { return false; } } return true; }; calculate(25000);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2ehjb
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   31     0  E >   INIT_FCALL                                               'calculate'
          1        SEND_VAL                                                 25000
          2        DO_FCALL                                      0          
          3      > RETURN                                                   1

Function calculate:
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 = 4
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 12
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 17
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
Branch analysis from position: 17
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 4
Branch analysis from position: 20
Branch analysis from position: 4
Branch analysis from position: 12
filename:       /in/2ehjb
function name:  calculate
number of ops:  21
compiled vars:  !0 = $N, !1 = $count, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        ASSIGN                                                   !1, 0
    5     2        ASSIGN                                                   !2, 1
    7     3      > JMP                                                      ->18
    8     4    >   INIT_FCALL_BY_NAME                                       'isPrime'
          5        SEND_VAR_EX                                              !2
          6        DO_FCALL                                      0  $5      
          7      > JMPZ                                                     $5, ->12
    9     8    >   NOP                                                      
          9        FAST_CONCAT                                      ~6      !2, '+is+prime%0A'
         10        ECHO                                                     ~6
   10    11        PRE_INC                                                  !1
   13    12    >   IS_IDENTICAL                                             !1, !0
         13      > JMPZ                                                     ~8, ->17
   14    14    >   CONCAT                                           ~9      !2, '%0A'
         15        ECHO                                                     ~9
   15    16      > JMP                                                      ->20
   18    17    >   PRE_INC                                                  !2
    7    18    >   IS_SMALLER_OR_EQUAL                                      !1, !0
         19      > JMPNZ                                                    ~11, ->4
   20    20    > > RETURN                                                   null

End of function calculate

Function isprime:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 10, Position 2 = 3
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
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
2 jumps found. (Code = 44) Position 1 = 10, Position 2 = 3
Branch analysis from position: 10
Branch analysis from position: 3
filename:       /in/2ehjb
function name:  isPrime
number of ops:  12
compiled vars:  !0 = $n, !1 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   RECV                                             !0      
   23     1        ASSIGN                                                   !1, 2
          2      > JMP                                                      ->8
   24     3    >   MOD                                              ~3      !0, !1
          4        IS_IDENTICAL                                             ~3, 0
          5      > JMPZ                                                     ~4, ->7
   25     6    > > RETURN                                                   <false>
   23     7    >   PRE_INC                                                  !1
          8    >   IS_SMALLER                                               !1, !0
          9      > JMPNZ                                                    ~6, ->3
   28    10    > > RETURN                                                   <true>
   29    11*     > RETURN                                                   null

End of function isprime

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.15 ms | 1403 KiB | 14 Q