3v4l.org

run code in 500+ PHP versions simultaneously
<?php $px = '1000px'; function get_cm_by_px($px, $dpi = 300, $precision = 2) { $comma = ','; // if US use '.' return number_format(2.54 * (int)$px / $dpi , $precision, $comma,'') ; } var_dump(get_cm_by_px($px));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Z1LmO
function name:  (null)
number of ops:  8
compiled vars:  !0 = $px
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, '1000px'
    9     1        INIT_FCALL                                                   'var_dump'
          2        INIT_FCALL                                                   'get_cm_by_px'
          3        SEND_VAR                                                     !0
          4        DO_FCALL                                          0  $2      
          5        SEND_VAR                                                     $2
          6        DO_ICALL                                                     
          7      > RETURN                                                       1

Function get_cm_by_px:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Z1LmO
function name:  get_cm_by_px
number of ops:  15
compiled vars:  !0 = $px, !1 = $dpi, !2 = $precision, !3 = $comma
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E >   RECV                                                 !0      
          1        RECV_INIT                                            !1      300
          2        RECV_INIT                                            !2      2
    5     3        ASSIGN                                                       !3, '%2C'
    6     4        INIT_FCALL                                                   'number_format'
          5        CAST                                              4  ~5      !0
          6        MUL                                                  ~6      ~5, 2.54
          7        DIV                                                  ~7      ~6, !1
          8        SEND_VAL                                                     ~7
          9        SEND_VAR                                                     !2
         10        SEND_VAR                                                     !3
         11        SEND_VAL                                                     ''
         12        DO_ICALL                                             $8      
         13      > RETURN                                                       $8
    7    14*     > RETURN                                                       null

End of function get_cm_by_px

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
211.69 ms | 2697 KiB | 16 Q