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)), ',', '.'); echo PHP_EOL; echo number_format(round($number2, 2), strlen(substr(strrchr($number2, "."), 1)), ',', '.');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/imeIK
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 >   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        ECHO                                                     $8
    9    22        ECHO                                                     '%0A'
   10    23        INIT_FCALL                                               'number_format'
         24        INIT_FCALL                                               'round'
         25        SEND_VAR                                                 !1
         26        SEND_VAL                                                 2
         27        DO_ICALL                                         $9      
         28        SEND_VAR                                                 $9
         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:
150.82 ms | 1396 KiB | 21 Q