3v4l.org

run code in 300+ PHP versions simultaneously
<?php $number1 = round(354.2550, 2); $number2 = round(38456.1000, 2); //echo strlen(substr(strrchr($number1, "."), 1)) . "<br />"; //echo strlen(substr(strrchr($number2, "."), 1)); echo number_format($number1, strlen(substr(strrchr($number1, "."), 1)), ',', '.'); echo PHP_EOL; echo number_format($number2, strlen(substr(strrchr($number2, "."), 1)), ',', '.');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dGNib
function name:  (null)
number of ops:  44
compiled vars:  !0 = $number1, !1 = $number2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'round'
          1        SEND_VAL                                                 354.255
          2        SEND_VAL                                                 2
          3        DO_ICALL                                         $2      
          4        ASSIGN                                                   !0, $2
    3     5        INIT_FCALL                                               'round'
          6        SEND_VAL                                                 38456.1
          7        SEND_VAL                                                 2
          8        DO_ICALL                                         $4      
          9        ASSIGN                                                   !1, $4
    8    10        INIT_FCALL                                               'number_format'
         11        SEND_VAR                                                 !0
         12        INIT_FCALL                                               'substr'
         13        INIT_FCALL                                               'strrchr'
         14        SEND_VAR                                                 !0
         15        SEND_VAL                                                 '.'
         16        DO_ICALL                                         $6      
         17        SEND_VAR                                                 $6
         18        SEND_VAL                                                 1
         19        DO_ICALL                                         $7      
         20        STRLEN                                           ~8      $7
         21        SEND_VAL                                                 ~8
         22        SEND_VAL                                                 '%2C'
         23        SEND_VAL                                                 '.'
         24        DO_ICALL                                         $9      
         25        ECHO                                                     $9
    9    26        ECHO                                                     '%0A'
   10    27        INIT_FCALL                                               'number_format'
         28        SEND_VAR                                                 !1
         29        INIT_FCALL                                               'substr'
         30        INIT_FCALL                                               'strrchr'
         31        SEND_VAR                                                 !1
         32        SEND_VAL                                                 '.'
         33        DO_ICALL                                         $10     
         34        SEND_VAR                                                 $10
         35        SEND_VAL                                                 1
         36        DO_ICALL                                         $11     
         37        STRLEN                                           ~12     $11
         38        SEND_VAL                                                 ~12
         39        SEND_VAL                                                 '%2C'
         40        SEND_VAL                                                 '.'
         41        DO_ICALL                                         $13     
         42        ECHO                                                     $13
         43      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.54 ms | 1388 KiB | 21 Q