3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Trying to output 18000 $time = 12000; // milli-seconds $time = floor($time/1000); // get it into even seconds $remainder = $time % 6; if ((bool)$remainder) { $time = ($time - $remainder + 6)*1000; } else { $time = $time*1000; } echo $time;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 15
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/P7VMp
function name:  (null)
number of ops:  19
compiled vars:  !0 = $time, !1 = $remainder
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ASSIGN                                                   !0, 12000
    6     1        INIT_FCALL                                               'floor'
          2        DIV                                              ~3      !0, 1000
          3        SEND_VAL                                                 ~3
          4        DO_ICALL                                         $4      
          5        ASSIGN                                                   !0, $4
    7     6        MOD                                              ~6      !0, 6
          7        ASSIGN                                                   !1, ~6
    8     8        BOOL                                             ~8      !1
          9      > JMPZ                                                     ~8, ->15
    9    10    >   SUB                                              ~9      !0, !1
         11        ADD                                              ~10     ~9, 6
         12        MUL                                              ~11     ~10, 1000
         13        ASSIGN                                                   !0, ~11
         14      > JMP                                                      ->17
   11    15    >   MUL                                              ~13     !0, 1000
         16        ASSIGN                                                   !0, ~13
   13    17    >   ECHO                                                     !0
         18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.84 ms | 1395 KiB | 15 Q