3v4l.org

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

End of function get_cm_by_px

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.84 ms | 1398 KiB | 18 Q