3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.36 ms | 1392 KiB | 21 Q