3v4l.org

run code in 300+ 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 = 7, Position 2 = 16
Branch analysis from position: 7
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: 16
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DULp4
function name:  (null)
number of ops:  25
compiled vars:  !0 = $number, !1 = $decimals
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 12500.2
    5     1        INIT_FCALL                                               'strpos'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 '.'
          4        DO_ICALL                                         $3      
          5        TYPE_CHECK                                  1018          $3
          6      > JMPZ                                                     ~4, ->16
    6     7    >   STRLEN                                           ~5      !0
          8        INIT_FCALL                                               'strpos'
          9        SEND_VAR                                                 !0
         10        SEND_VAL                                                 '.'
         11        DO_ICALL                                         $6      
         12        ADD                                              ~7      $6, 1
         13        SUB                                              ~8      ~5, ~7
         14        ASSIGN                                                   !1, ~8
    5    15      > JMP                                                      ->17
    8    16    >   ASSIGN                                                   !1, 0
   11    17    >   INIT_FCALL                                               'number_format'
         18        SEND_VAR                                                 !0
         19        SEND_VAR                                                 !1
         20        SEND_VAL                                                 '%2C'
         21        SEND_VAL                                                 '+'
         22        DO_ICALL                                         $11     
         23        ECHO                                                     $11
         24      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.61 ms | 1006 KiB | 15 Q