3v4l.org

run code in 300+ PHP versions simultaneously
<?php function ex_round($_,$__ = 1){ if(0== round($_, $__, PHP_ROUND_HALF_EVEN)){ return ex_round($_,$__+1); } return round($_, $__, PHP_ROUND_HALF_EVEN); } echo ex_round(0.005); echo ex_round(1.005); echo PHP_EOL; echo round(0.005, 1, PHP_ROUND_HALF_ODD);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SKLdv
function name:  (null)
number of ops:  16
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_FCALL                                               'ex_round'
          1        SEND_VAL                                                 0.005
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
   10     4        INIT_FCALL                                               'ex_round'
          5        SEND_VAL                                                 1.005
          6        DO_FCALL                                      0  $1      
          7        ECHO                                                     $1
   11     8        ECHO                                                     '%0A'
   12     9        INIT_FCALL                                               'round'
         10        SEND_VAL                                                 0.005
         11        SEND_VAL                                                 1
         12        SEND_VAL                                                 4
         13        DO_ICALL                                         $2      
         14        ECHO                                                     $2
         15      > RETURN                                                   1

Function ex_round:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 15
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SKLdv
function name:  ex_round
number of ops:  22
compiled vars:  !0 = $_, !1 = $__
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      1
    3     2        INIT_FCALL                                               'round'
          3        SEND_VAR                                                 !0
          4        SEND_VAR                                                 !1
          5        SEND_VAL                                                 3
          6        DO_ICALL                                         $2      
          7        IS_EQUAL                                                 $2, 0
          8      > JMPZ                                                     ~3, ->15
    4     9    >   INIT_FCALL_BY_NAME                                       'ex_round'
         10        SEND_VAR_EX                                              !0
         11        ADD                                              ~4      !1, 1
         12        SEND_VAL_EX                                              ~4
         13        DO_FCALL                                      0  $5      
         14      > RETURN                                                   $5
    6    15    >   INIT_FCALL                                               'round'
         16        SEND_VAR                                                 !0
         17        SEND_VAR                                                 !1
         18        SEND_VAL                                                 3
         19        DO_ICALL                                         $6      
         20      > RETURN                                                   $6
    7    21*     > RETURN                                                   null

End of function ex_round

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
287.77 ms | 1403 KiB | 18 Q