3v4l.org

run code in 300+ PHP versions simultaneously
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Primes</title> </head> <body> <p id="line">Prime numbers less than 100: </p> </body> </html> <?php /** * Created by PhpStorm. * User: lilit * Date: 7/9/17 * Time: 8:44 PM */ function checkPrime() { for ($i = 2; $i < 100; $i++) { $primeTrue = true; for ($j = 2; $j <= sqrt($i); $j++) { if ($i % $j === 0) { $primeTrue = false; } } if ($primeTrue) { echo $i.' '; } } } checkPrime(); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YQs1h
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    1     0  E >   ECHO                                                     '%3C%21DOCTYPE+html%3E%0A%3Chtml+lang%3D%22en%22%3E%0A%3Chead%3E%0A%0A++++%3Cmeta+charset%3D%22UTF-8%22%3E%0A++++%3Ctitle%3EPrimes%3C%2Ftitle%3E%0A%0A%3C%2Fhead%3E%0A%3Cbody%3E%0A%0A%0A++++%3Cp+id%3D%22line%22%3EPrime+numbers+less+than+100%3A+%3C%2Fp%3E%0A%0A%3C%2Fbody%3E%0A%3C%2Fhtml%3E%0A%0A'
   39     1        INIT_FCALL                                               'checkprime'
          2        DO_FCALL                                      0          
   40     3      > RETURN                                                   1

Function checkprime:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 2
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 2
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 15, Position 2 = 5
Branch analysis from position: 15
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 18
Branch analysis from position: 16
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 2
Branch analysis from position: 21
Branch analysis from position: 2
Branch analysis from position: 18
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 9
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 15, Position 2 = 5
Branch analysis from position: 15
Branch analysis from position: 5
Branch analysis from position: 9
filename:       /in/YQs1h
function name:  checkPrime
number of ops:  22
compiled vars:  !0 = $i, !1 = $primeTrue, !2 = $j
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   ASSIGN                                                   !0, 2
          1      > JMP                                                      ->19
   27     2    >   ASSIGN                                                   !1, <true>
   28     3        ASSIGN                                                   !2, 2
          4      > JMP                                                      ->10
   29     5    >   MOD                                              ~6      !0, !2
          6        IS_IDENTICAL                                             ~6, 0
          7      > JMPZ                                                     ~7, ->9
   30     8    >   ASSIGN                                                   !1, <false>
   28     9    >   PRE_INC                                                  !2
         10    >   INIT_FCALL                                               'sqrt'
         11        SEND_VAR                                                 !0
         12        DO_ICALL                                         $10     
         13        IS_SMALLER_OR_EQUAL                                      !2, $10
         14      > JMPNZ                                                    ~11, ->5
   33    15    > > JMPZ                                                     !1, ->18
   34    16    >   CONCAT                                           ~12     !0, '+'
         17        ECHO                                                     ~12
   26    18    >   PRE_INC                                                  !0
         19    >   IS_SMALLER                                               !0, 100
         20      > JMPNZ                                                    ~14, ->2
   37    21    > > RETURN                                                   null

End of function checkprime

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.79 ms | 1403 KiB | 16 Q