3v4l.org

run code in 500+ PHP versions simultaneously
<?php $data = '10 x 2,5'; echo preg_replace_callback('/(\d+(?:[.,]\d+)?)\h*x\h*(\d+(?:[.,]\d+)?)/', function($match) { return str_replace(',' , '.', $match[1]) * str_replace(',' , '.', $match[2]); }, $data);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/I82Gt
function name:  (null)
number of ops:  9
compiled vars:  !0 = $data
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, '10+x+2%2C5'
    3     1        INIT_FCALL                                                   'preg_replace_callback'
          2        SEND_VAL                                                     '%2F%28%5Cd%2B%28%3F%3A%5B.%2C%5D%5Cd%2B%29%3F%29%5Ch%2Ax%5Ch%2A%28%5Cd%2B%28%3F%3A%5B.%2C%5D%5Cd%2B%29%3F%29%2F'
          3        DECLARE_LAMBDA_FUNCTION                              ~2      [0]
    5     4        SEND_VAL                                                     ~2
          5        SEND_VAR                                                     !0
    3     6        DO_ICALL                                             $3      
    5     7        ECHO                                                         $3
          8      > 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/I82Gt
function name:  {closure:/in/I82Gt:3}
number of ops:  10
compiled vars:  !0 = $match
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   RECV                                                 !0      
    4     1        FETCH_DIM_R                                          ~1      !0, 1
          2        FRAMELESS_ICALL_3                str_replace         ~2      '%2C', '.'
          3        OP_DATA                                                      ~1
          4        FETCH_DIM_R                                          ~3      !0, 2
          5        FRAMELESS_ICALL_3                str_replace         ~4      '%2C', '.'
          6        OP_DATA                                                      ~3
          7        MUL                                                  ~5      ~2, ~4
          8      > RETURN                                                       ~5
    5     9*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
164.87 ms | 2370 KiB | 14 Q