3v4l.org

run code in 500+ PHP versions simultaneously
<?php $string = "225cm x 70cm"; if (preg_match_all('/\d+(?:\.\d+)?/', $string, $m)) { $inches = implode(" ", array_map(function ($x) { return round(intval($x) * 0.39370 / 0.5) * 0.5; }, $m[0])); echo $inches; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 16
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/5jUol
function name:  (null)
number of ops:  17
compiled vars:  !0 = $string, !1 = $m, !2 = $inches
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, '225cm+x+70cm'
    4     1        INIT_FCALL                                                   'preg_match_all'
          2        SEND_VAL                                                     '%2F%5Cd%2B%28%3F%3A%5C.%5Cd%2B%29%3F%2F'
          3        SEND_VAR                                                     !0
          4        SEND_REF                                                     !1
          5        DO_ICALL                                             $4      
          6      > JMPZ                                                         $4, ->16
    5     7    >   INIT_FCALL                                                   'array_map'
          8        DECLARE_LAMBDA_FUNCTION                              ~5      [0]
          9        SEND_VAL                                                     ~5
         10        FETCH_DIM_R                                          ~6      !1, 0
         11        SEND_VAL                                                     ~6
         12        DO_ICALL                                             $7      
         13        FRAMELESS_ICALL_2                implode             ~8      '+', $7
         14        ASSIGN                                                       !2, ~8
    6    15        ECHO                                                         !2
    7    16    > > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5jUol
function name:  {closure:/in/5jUol:5}
number of ops:  10
compiled vars:  !0 = $x
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   RECV                                                 !0      
          1        INIT_FCALL                                                   'round'
          2        CAST                                              4  ~1      !0
          3        MUL                                                  ~2      ~1, 0.3937
          4        DIV                                                  ~3      ~2, 0.5
          5        SEND_VAL                                                     ~3
          6        DO_ICALL                                             $4      
          7        MUL                                                  ~5      $4, 0.5
          8      > RETURN                                                       ~5
          9*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
160.09 ms | 1970 KiB | 16 Q