3v4l.org

run code in 300+ PHP versions simultaneously
<?php function roundDown($var){ $len = strlen($var)-1; $divide = 1; for($i=1;$i<=$len;$i++){ $divide .= 0; } return floor($var/$divide)*$divide; } echo roundDown(23);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/M23TT
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_FCALL                                               'rounddown'
          1        SEND_VAL                                                 23
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
          4      > RETURN                                                   1

Function rounddown:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 11, Position 2 = 7
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 11, Position 2 = 7
Branch analysis from position: 11
Branch analysis from position: 7
filename:       /in/M23TT
function name:  roundDown
number of ops:  18
compiled vars:  !0 = $var, !1 = $len, !2 = $divide, !3 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1        STRLEN                                           ~4      !0
          2        SUB                                              ~5      ~4, 1
          3        ASSIGN                                                   !1, ~5
    4     4        ASSIGN                                                   !2, 1
    5     5        ASSIGN                                                   !3, 1
          6      > JMP                                                      ->9
    6     7    >   ASSIGN_OP                                     8          !2, 0
    5     8        PRE_INC                                                  !3
          9    >   IS_SMALLER_OR_EQUAL                                      !3, !1
         10      > JMPNZ                                                    ~11, ->7
   10    11    >   INIT_FCALL                                               'floor'
         12        DIV                                              ~12     !0, !2
         13        SEND_VAL                                                 ~12
         14        DO_ICALL                                         $13     
         15        MUL                                              ~14     !2, $13
         16      > RETURN                                                   ~14
   11    17*     > RETURN                                                   null

End of function rounddown

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.87 ms | 1398 KiB | 16 Q