3v4l.org

run code in 500+ PHP versions simultaneously
<?php $number = 50001/4; If(strpos($number, ".") !== false){ $decimals = strlen($number) - (strpos($number, ".")+1); }Else{ $decimals =0; } Echo number_format($number, $decimals, ',', ' ');
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 10
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DULp4
function name:  (null)
number of ops:  19
compiled vars:  !0 = $number, !1 = $decimals
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, 12500.2
    5     1        FRAMELESS_ICALL_2                strpos              ~3      !0, '.'
          2        TYPE_CHECK                                      1018          ~3
          3      > JMPZ                                                         ~4, ->10
    6     4    >   STRLEN                                               ~5      !0
          5        FRAMELESS_ICALL_2                strpos              ~6      !0, '.'
          6        ADD                                                  ~7      ~6, 1
          7        SUB                                                  ~8      ~5, ~7
          8        ASSIGN                                                       !1, ~8
    5     9      > JMP                                                          ->11
    8    10    >   ASSIGN                                                       !1, 0
   11    11    >   INIT_FCALL                                                   'number_format'
         12        SEND_VAR                                                     !0
         13        SEND_VAR                                                     !1
         14        SEND_VAL                                                     '%2C'
         15        SEND_VAL                                                     '+'
         16        DO_ICALL                                             $11     
         17        ECHO                                                         $11
         18      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
164.55 ms | 2003 KiB | 14 Q